我的桌子是
sh_name,sh_count,shoba
1\x{e76f}
2\x{e76f}7.1
3-2-1
1-6-2
2\x{e 010}5
3 3 2
我想在shoba 2中将字段sh_name中的最大记录从3更新到11,我使用此代码,但不工作。
更新工作表集sh_count = 11其中sh_name =(从shoba =2的工作表中选择max(sh_name) )
发布于 2015-03-31 20:47:12
如果只想更新一行,需要重复shoba = 2条件,如下所示:
UPDATE sheet SET sh_count = 11
WHERE sh_name = (SELECT MAX(sh_name) FROM sheet WHERE shoba = 2)
AND shoba = 2https://stackoverflow.com/questions/29376850
复制相似问题