Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SELECT * FROM emp e LEFT OUTER JOIN dep d ON e.Dno=d.Dno UNION SELECT * FROM emp e RIGHT OUTER JOIN dep d ON e.Dno=d.Dno
我想将由此产生的结果用于另一个选择查询。我怎样才能做到这一点?
我只有 emp 和 dep 表。
我认为您正在寻找子查询。http://www.w3resource.com/sql/subqueries/understanding-sql-subqueries.php