I have a requirment similar to following
select * from emp where deptno=10
List 3 rows
I want to include an indicator DEPT_IND with values 'Y' or 'N' for these 7 rows ,
DEPT_IND has a value 'Y' when the row returned by the above query has an enrty for the condition deptno=20 in the emp table .
How can I include this in the query
sample table data.
emp
empno ename deptno
121 xxx 10
121 xxx 20
123 yyy 10
124 zzz 10
I should get the o/p as
empno ename DEPT_IND
121 xxx Y
123 yyy N
124 zzz N
Thanks for your help.
Hena.