首選先看看這條語句html
DELETE FROM tb_task t WHERE t.`groupname` = 'xxx' AND t.`create_time` > '2013-08-20 14:24:00' AND t.`filter` IS NULL
這句代碼在sql裏會報錯, 因爲 tb_task 取了別名 因此,須要在 delete 和from中間 加上別名 t.mysql
詳見最後個答案 [http://stackoverflow.com/questions/4471277/mysql-delete-from-with-subquery-as-condition] sql
mysql manual [http://dev.mysql.com/doc/refman/5.5/en/delete.html]spa