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
I want to use the result coming from this to another select query. How can I do that?
I only have emp and dep tables.
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
I want to use the result coming from this to another select query. How can I do that?
I only have emp and dep tables.
I think you are looking for subqueries. http://www.w3resource.com/sql/subqueries/understanding-sql-subqueries.php