這裏是我的查詢:問題的SQL查詢[內連接和多種選擇]
SELECT * FROM
(SELECT messages.*,
users.*
FROM `afo_messages` as messages
INNER JOIN `key_users` as users ON messages.user_id = users.id
WHERE messages.category_id=5
ORDER BY messages.id DESC LIMIT 30) ilv
ORDER BY messages.id ASC
錯誤是「#1060 - 重複列名‘身份證’。」
表afo_messages列:
id | user_id | category_id | parent_id | message | create_date | update_date | status
表key_users列:
id | name | email | phone | pwd | active | role | invite_id | download_link | date
我做錯了嗎?
感謝名單!
這是正確的,但我錯誤:#1054 - '訂單子句'中的未知列'messages.id'。我認爲這是因爲這ORDER BY messages.id ASC – Mirgorod
嗯...如何解決它? – Mirgorod
我編輯過thge推薦 –