Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Query Help Needed
I would like to know how I can implement a if/then type logic when selecting from two tables in sub query?
I want the outer query to:
1st table in sub query brings up departments that have more than zero persons in it.
2nd table in subquery brings up departments from another table and manufactures a zero for # of people.
SELECT deptno, num_people
FROM
(SELECT deptno, num_people FROM tableA
UNION ALL
SELECT deptno, '000' as num_people FROM tableB)
Any help would be immensely appreciated!
GZ Received on Sat Feb 17 2001 - 08:13:09 CST
![]() |
![]() |