我正在使用以下 SQL 语句:
SELECT reply.id, reply.content, author.username
FROM thread, reply, author
JOIN thread_reply ON thread.id = thread_reply.thread_id
JOIN reply ON thread_reply.reply_id = reply.id
JOIN author_reply ON thread.id = author_reply.thread_id
JOIN author ON author_reply.author_id = author.id
WHERE thread.id = '40'
我有以下表格:
thread_reply: thread_id, reply_id
reply: id, content, created (timestamp)
author: id, username, password_hash, salt #etc
thread: id, content, created
author_reply: author_id, reply_id
我不断收到以下错误:
#1066 - Not unique table/alias: 'reply'
哦,我正在使用 MySQL。