I ask for help in rewriting a code snippet yesterday for MYSQL from Access and Discovered I pasted the wrong snippet here is the right one Could some help in rewriting this for mysql??
select a.Unique_ID, a.Date_Creation, a.createdBy_UserName, a.replies, a.views, a.lastPost_UserName, a.subject, a.Date_LastPost, a.locked, a.announcement, a.lastPost_UserID, a.createdBy_UserID, a.movedFrom, null as lastVisit, (select top 1 answer from Gerobase_Forum_Messages c where c.answer = true and c.topic_ID = a.Unique_ID) as answered from Gerobase_Forum_Topics a where a.forum_ID = 24 order by a.announcement, a.Date_LastPost desc
I have changed c.answer = true to c.answer = 1 (and 0) with no success
the error message is
Syntax error or access violation: You have an error in your SQL syntax near 'select top 1 answer from Gerobase_Forum_Messages c where c.answer = true and c.t' at line 5
select a.Unique_ID, a.Date_Creation, a.createdBy_UserName, a.replies, a.views, a.lastPost_UserName, a.subject, a.Date_LastPost, a.locked, a.announcement, a.lastPost_UserID, a.createdBy_UserID, a.movedFrom, null as lastVisit, (select top 1 answer from Gerobase_Forum_Messages c where c.answer = true and c.topic_ID = a.Unique_ID) as answered from Gerobase_Forum_Topics a where a.forum_ID = 24 order by a.announcement, a.Date_LastPost desc
I have changed c.answer = true to c.answer = 1 (and 0) with no success
the error message is
Syntax error or access violation: You have an error in your SQL syntax near 'select top 1 answer from Gerobase_Forum_Messages c where c.answer = true and c.t' at line 5