Access to MySql 5 -> help with syntax error needed
Posted by:
John F
Date: March 21, 2006 05:47PM
The following query works perfectly on both MS Access and MS Sql Server. I now need to use it with MySql 5 and it falls over giving me this error message:
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 MAX( FA01 . PHOTO_ID ) FROM FORUM_ALBUM AS FA01 WHERE FA
The query is:
SELECT FA1.PHOTO_ID, FA1.PHOTO_NAME, FAU1.MEMBER_ID, FAU1.M_NAME
FROM FORUM_ALBUM_USERS AS FAU1
INNER JOIN FORUM_ALBUM AS FA1 ON FAU1.MEMBER_ID = FA1.MEMBER_ID
WHERE (((FA1.PHOTO_ID) = (SELECT MAX( FA01.PHOTO_ID )FROM FORUM_ALBUM AS FA01
WHERE FA01.MEMBER_ID = FA1.MEMBER_ID
GROUP BY FA01.MEMBER_ID))
AND ((FA1.PHOTO_STATUS) =1))ORDER BY FA1.PHOTO_ID DESC
LIMIT 0 , 30
I've never used MySql 5 before and the various changes I tried just got me nowhere. From reading the documentation I believe the problem may be how MySql 5 is handling the column aliases.
If someone could give me a pointer as to where this is going wrong I'd be appreciative.
JohnF
Subject
Views
Written By
Posted
Access to MySql 5 -> help with syntax error needed
3285
March 21, 2006 05:47PM
1811
March 21, 2006 06:19PM
1719
March 21, 2006 06:39PM
1633
March 21, 2006 08:24PM
1516
March 22, 2006 04:47AM
1654
March 22, 2006 10:56AM
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.