2014-10-09 129 views
0

這可能是個簡單的問題,但我對mysql的查詢不太好。從mysql表中刪除使用where和where條件

即時通訊嘗試此查詢從表中刪除某些項目,但出現錯誤。 這是詢問:

DELETE FROM sys_forms_in_groups WHERE FormID IN (6,7,23,41) AND WHERE GroupID = 2 

這是我得到的錯誤。

Error Code: 1064 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where GroupID = 2' at line 1 

這是我想從中刪除記錄的表格。 enter image description here

+0

SQL正在跟你說'near' =>''其中GroupID' – 2014-10-10 00:17:27

回答

5

你有你的條款多餘WHERE

DELETE FROM sys_forms_in_groups WHERE FormID IN (6,7,23,41) AND WHERE GroupID = 2 
                   ^here 

刪除認爲,它應該是罰款。

+0

Thankyou。您的解決方案工作順利。 – 2014-10-10 01:07:27

+0

@SizzlingCode im很高興這有幫助 – Ghost 2014-10-10 01:07:35