SQL DELETE语句用于从数据库表中删除一行或多行数据。DELETE语句的用法如下:
DELETE FROM 表名;
DELETE FROM 表名 WHERE 条件;
DELETE FROM 表名 WHERE 列名 = 值;
DELETE FROM 表名 WHERE 条件1 AND 条件2;
DELETE FROM 表名 WHERE 条件1 OR 条件2;
DELETE TOP(N) FROM 表名;
DELETE FROM 表名 WHERE 列名 NOT IN (SELECT MIN(列名) FROM 表名 GROUP BY 列名);
注意:在使用DELETE语句时要谨慎操作,因为删除的数据将无法恢复。在执行DELETE语句之前,建议先备份数据或使用事务进行操作。