duanan1228
duanan1228
2016-01-25 16:14

SQLSTATE [21000]:基数违规:1241操作数应包含1列

已采纳

First, I know what this error means, but I don't understand why it's appearing. I use this query to update data (it is select generated by framework).

UPDATE `achievement` SET `name`='OKer', `description`='sadsad',`IdAchievement`='2' WHERE (`IdAchievement`, '2')

I have these records in my database:

IdAchievement | name | description | IdGame
1 | Super achievement| description | 1
2 | OK| sadsad | 1
5 | dsfs| | 1

IdAchievement is a primary key, IdGame is a foreign key to the Game table.

Can you help me please? I really do not understand it...

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doujia7094 doujia7094 5年前

    Change your query to the following:

    UPDATE `achievement` SET `name`='OKer', `description`='sadsad',`IdAchievement`='2' WHERE `IdAchievement` = '2'
    
    点赞 评论 复制链接分享