我得到了这个代码:
SELECT
topics.id,
topics.id_first,
posts.id_first
FROM topics
LEFT
JOIN posts
ON posts.id = topics.id_first_msg
我的意图是做这样的事情:
SELECT
topics.id,
topics.id_first,
posts.id_first,
posts.id_last
FROM topics
LEFT
JOIN posts
ON posts.id = topics.id_first_msg
LEFT
JOIN posts
ON posts.id = topics.id_last_msg
但是,当我尝试两次 Left Join 时,我得到一个错误。那么哪个是正确的方法呢?谢谢。