Hi,
I have two simple queries ... that work in MS Access but do not work in MySQL.
One is a selection query and the other is a deletion query that uses the same criteria as the selection query.
Here is the SQL for the SELECTION QUERY:
SELECT ibf_message_text.msg_id, ibf_message_text.msg_post, ibf_message_text.msg_author_id
FROM ibf_message_text
WHERE ibf_message_text.msg_id IN
(SELECT ibf_message_text.msg_id
FROM ibf_message_text LEFT JOIN ibf_members ON ibf_message_text.msg_author_id = ibf_members.id
WHERE (((ibf_members.id) Is Null)));
Here is the SQL for the DELETION QUERY:
DELETE *
FROM ibf_message_text
WHERE ibf_message_text.msg_id IN
(SELECT ibf_message_text.msg_id
FROM ibf_message_text LEFT JOIN ibf_members ON ibf_message_text.msg_author_id = ibf_members.id
WHERE (((ibf_members.id) Is Null)));
The error message returned is:
"
MySQL said:
#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 'SELECT ibf_message_text . msg_id FROM ibf_message_text LEFT JO
"
Any help would be much appreciated ... also is the "*" necessary in the DELETE query and is the ";" semicolon necessary to close the SQL statment?
Thanks!
I have two simple queries ... that work in MS Access but do not work in MySQL.
One is a selection query and the other is a deletion query that uses the same criteria as the selection query.
Here is the SQL for the SELECTION QUERY:
SELECT ibf_message_text.msg_id, ibf_message_text.msg_post, ibf_message_text.msg_author_id
FROM ibf_message_text
WHERE ibf_message_text.msg_id IN
(SELECT ibf_message_text.msg_id
FROM ibf_message_text LEFT JOIN ibf_members ON ibf_message_text.msg_author_id = ibf_members.id
WHERE (((ibf_members.id) Is Null)));
Here is the SQL for the DELETION QUERY:
DELETE *
FROM ibf_message_text
WHERE ibf_message_text.msg_id IN
(SELECT ibf_message_text.msg_id
FROM ibf_message_text LEFT JOIN ibf_members ON ibf_message_text.msg_author_id = ibf_members.id
WHERE (((ibf_members.id) Is Null)));
The error message returned is:
"
MySQL said:
#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 'SELECT ibf_message_text . msg_id FROM ibf_message_text LEFT JO
"
Any help would be much appreciated ... also is the "*" necessary in the DELETE query and is the ";" semicolon necessary to close the SQL statment?
Thanks!