1 select a.a, a.b, b.c
2 FROM (select p a ,count(1) b FROM TEST1 GROUP BY P) a,
3 (select p1,COUNT(1) c FROM TEST2 GROUP BY P1) b
4* where a.a = b.c(+)
SQL> /

A B C
---------- ---------- ----------
1 3
2 2


When i use the outer join the query returns as above.

Regards
Shyla