sql删除列

时间:2018-07-12 13:01:35

标签: sql sql-delete

表中有四列

如果a4列为空,我想删除

enter image description here

那我为什么要写代码

delete MAX(ID) as a1,a2,a3,a4 
FROM dbo.T07StokDurum where a4 is null
GROUP BY DesenKodu,Ebat
HAVING COUNT(*) > 1

2 个答案:

答案 0 :(得分:0)

您的删除语法不正确。参见SQL DELETE Statement

DELETE FROM dbo.T07StokDurum WHERE a4 IS NULL

答案 1 :(得分:0)

如果您要删除A4列为空的整行,只需:

DialogRef

..会的。不需要您编写的其余代码。除非您尝试执行其他未指定的操作。