這是SQL的錯誤:MySQL的語法錯誤,但一切似乎正確
Error: 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 ') and (pi.perm_type='forum' and (pi.perm_2='*' OR pi.perm_2 LIKE '%,4,%')) and' at line 2
這是SQL查詢:
SELECT t.tid AS id, t.title, t.last_poster_id AS id2,m.member_group_id,
m.members_display_name AS statistic,pi.perm_2 FROM topics t LEFT JOIN members m ON (
m.member_id = t.last_poster_id)
LEFT JOIN permission_index pi ON (pi.app='forums' AND pi.perm_type='forum' AND
pi.perm_type_id=t.forum_id) WHERE t.forum_id NOT IN() AND (pi.perm_type='forum' AND (
pi.perm_2='*' OR pi.perm_2 LIKE '%,4,%')) AND t.approved=1 AND (t.moved_to='' OR
t.moved_to IS NULL) ORDER BY t.last_post DESC LIMIT 0,11
現在,這個查詢運行在我的MySQL本地安裝罰款(XAMPP )。
難道是不同的MySQL版本會導致此查詢中的SQL錯誤?那究竟是什麼造成了錯誤?
「LIKE」運算符?
where子句中的嵌套語句? (之間())
還有別的嗎?
在此先感謝!
+1用於查找更多錯誤並暗示格式化。 – dgw
非常感謝您的幫助! –