DELETE
FROM relevantkf
INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
WHERE relevantkf.keyID = 5
AND itemreview.taskID = 1
AND itemreview.projectID = 3
แบบนี้ก็ถูกต้องตามฟอร์มแล้วนิคะ แต่มันบอก
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
' at line 3
แต่ถ้า้ปลี่ยนเป็น Code (SQL)
DELETE relevantkf
FROM relevantkf
INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
WHERE relevantkf.keyID = 5
AND itemreview.taskID = 1
AND itemreview.projectID = 3
DELETE relevantkf
FROM relevantkf
INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
WHERE relevantkf.keyID = 5
AND itemreview.taskID = 1
AND itemreview.projectID = 3
DELETE relevantkf.*
FROM relevantkf
INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
WHERE relevantkf.keyID = 5
AND itemreview.taskID = 1
AND itemreview.projectID = 3
ลบจากสองตาราง กรณีไม่ได้ทำ FK Code (SQL)
DELETE relevantkf.*, itemreview.*
FROM relevantkf
INNER JOIN itemreview ON relevantkf.itemID = itemreview.itemID
WHERE relevantkf.keyID = 5
AND itemreview.taskID = 1
AND itemreview.projectID = 3