column = 'String_Value'
column (+) = 'String_Value'
SQL> select d.deptno, d.dname, count(e.empno) cnt
2 from dept d, emp e
3 where e.deptno (+) = d.deptno
4 and e.ename = 'SMITH'
5 group by d.deptno, d.dname
6 order by d.deptno
7 /
DEPTNO DNAME CNT
---------- -------------- ----------
20 RESEARCH 1
1 row selected.
SQL> select d.deptno, d.dname, count(e.empno) cnt
2 from dept d, emp e
3 where e.deptno (+) = d.deptno
4 and e.ename (+) = 'SMITH'
5 group by d.deptno, d.dname
6 order by d.deptno
7 /
DEPTNO DNAME CNT
---------- -------------- ----------
10 ACCOUNTING 0
20 RESEARCH 1
30 SALES 0
40 OPERATIONS 0
4 rows selected.
Best Regards,
Moorthy. G
No comments:
Post a Comment