update bk set photo15=NULL where fid=15or update bk set photo15='' where fid=15
改为delete from bk where fid=15
update bk set photo1='photo15' where fid=15; delete from bk where fid=15
我试了update bk set photo15=NULL where fid=15可以,我想知道为什么delete photo15报错
delete是删除行,不是删除列 删除列用alter table bk drop column photo15
delete photo15 --#1.delete后跟的是表的名字,所以报错. from bk where fid=15 GOupdate bk set photo1=photo15, photo15='' --#2.加上这句,清空字段值 where fid=15 GOALTER TABLE bk --#3.删除列 DROP COLUMN photo15 GO
update bk set photo1='photo15' where fid=15;
delete from bk where fid=15
删除列用alter table bk drop column photo15
from bk
where fid=15
GOupdate bk
set photo1=photo15,
photo15='' --#2.加上这句,清空字段值
where fid=15
GOALTER TABLE bk --#3.删除列
DROP COLUMN photo15
GO