标签: mysql database
我有一个名为Flags的列的行,我希望在该列中的标志数达到100时删除某一行。 SELECT IF(Flags = 100, DELETE, "false") FROM posts WHERE ID = 6; 这显然没有用。
SELECT IF(Flags = 100, DELETE, "false") FROM posts WHERE ID = 6;
答案 0 :(得分:3)
DELETE FROM posts WHERE ID = 6 AND Flags >= 100;