Can someone help me understand what's wrong with this query:
DELETE FROM noteproject
INNER JOIN note ON noteproject.noteID = note.noteID
INNER JOIN person ON note.personID = person.personID
WHERE noteID = '#attributes.noteID#'
AND personID = '#attributes.personID#'
解决方案
Use:
DELETE FROM NOTEPROJECT
WHERE noteID = '#attributes.noteID#'
AND note_id IN (SELECT n.note_id
FROM NOTE n
WHERE n.personID = '#attributes.personID#')
...or using EXISTS:
DELETE FROM NOTEPROJECT
WHERE noteID = '#attributes.noteID#'
AND EXISTS (SELECT NULL
FROM NOTE n
WHERE n.note_id = note_id
AND n.personID = '#attributes.personID#')