更新SQL查询要更新的多个字段

更新SQL查询要更新的多个字段,sql,sql-update,Sql,Sql Update,试图通过更新查询更新我的表,请参见下面的查询,不确定这是否是问题所在 update tb1 set class='X' and SUB_CLASSIFICATION='XX' where id=12345 and loc='0250' and TYPE='I' and CLASSIFICATION='B10' 在集合中使用逗号,代替和 update tb1 set class='X', SUB_CLASSIFICATION='XX' where id=12345 and loc='0250

试图通过更新查询更新我的表,请参见下面的查询,不确定这是否是问题所在

update tb1 set class='X' and SUB_CLASSIFICATION='XX' where id=12345 and 
loc='0250' and TYPE='I' and CLASSIFICATION='B10'

集合中使用逗号
代替

update tb1 set class='X', SUB_CLASSIFICATION='XX' where id=12345 and 
loc='0250' and TYPE='I' and CLASSIFICATION='B10'

您需要一个“
”来更新多个

update tb1 set class='X',SUB_CLASSIFICATION='XX' where id=12345 and 
loc='0250' and TYPE='I' and CLASSIFICATION='B10'

是的,您的第一个和应该是逗号(,)。

在集合部分,ypu必须使用“,”-而不是和

update tb1 set class='X', SUB_CLASSIFICATION='XX' where id=12345 and 
loc='0250' and TYPE='I' and CLASSIFICATION='B10'

更新tb1集合class='X',子分类class='XX'
其中id=12345和loc='0250'以及TYPE='I'和CLASSIFICATION='B10'

三个同时回答:将第一个
更改为逗号。
update tb1 set class='X', SUB_CLASSIFICATION='XX' where id=12345 and 
loc='0250' and TYPE='I' and CLASSIFICATION='B10'