MySQL Forums
Forum List  »  Microsoft Access

Who Can Help Me Convert This Working Access SQL to MySQL?
Posted by: xiang shu
Date: August 29, 2011 01:50AM

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)));ping k15
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!



Edited 1 time(s). Last edit at 09/21/2011 01:31AM by xiang shu.

Options: ReplyQuote


Subject
Views
Written By
Posted
Who Can Help Me Convert This Working Access SQL to MySQL?
7515
August 29, 2011 01:50AM
2599
February 24, 2012 02:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.