SELECT sessions_compare.*
FROM archive_sessions as f_session, sessions_compare
LEFT JOIN archive_sessions as s_session ON (s_session.id = sessions_compare.second_session_id)
LEFT JOIN consols as f_consol ON (f_session.console_id = f_consol.id)
where sessions_compare.first_session_id = f_session.id
在执行 get 错误后
错误:对表“f_session”的 FROM 子句条目的无效引用第 13 行:
LEFT JOIN consols as f_consol ON (f_session.console_id =...提示:表“f_session”有一个条目,但不能从这部分查询中引用它。
当我切换位置并遇到from
类似的sessions_compare, archive_sessions as f_session
错误时
错误:对表“sessions_compare”第 4 行的 FROM 子句条目的无效引用:...archive_sessions as s_session ON (s_session.id = sessions_c...
提示:表“sessions_compare”有一个条目,但不能从这部分查询中引用它。
唯一有效的是
SELECT sessions_compare.*
FROM sessions_compare
LEFT JOIN archive_sessions as s_session ON (s_session.id = sessions_compare.second_session_id)
,archive_sessions as f_session
LEFT JOIN consols as f_consol ON (f_session.console_id = f_consol.id)
where sessions_compare.first_session_id = f_session.id
我的问题是正常吗?当使用来自表的多个连接时,我在 mysql 中的 Postgresql 中很年轻()