試圖刪除由單個語句中的子選擇生成的id列表。這可能嗎?我一直在嘗試以下:子選擇在一個where-in子句中
[編輯]修正查詢
DELETE from store
WHERE id in (SELECT store.id
FROM storeInfo
JOIN store ON storeInfo.store_id = store.id
WHERE storeInfo.type = 17)
但是,這是不正確的語法...不知道如何正確建立這個。
什麼是對'storeInfo'的'JOIN'的目的是什麼?你沒有在子查詢的「SELECT」或「WHERE」中使用它。 'store.type'應該是'storeInfo.type'嗎? –
爲什麼你不只是有「從商店 WHERE store.type = 17」刪除,因爲你反正沒有使用storeInfo表 – randominstanceOfLivingThing
抱歉,在這裏輸入了一個錯誤。 'type'在信息表中 – Will