Hi,
I want to display the department no. and the no. of employee in each department from EMP Table.(in a Single Row). Pls help me how to write the query for that.
I had one query which display the result in 3 rows.
select deptno, count(*) from emp
group by deptno;
Dptno Count(*)
10 5
20 3
30 4
I want to display this 3 rows in a single-row.
For Eg:
Dpt10 Count(*) Dpt20 Count(*) Dpt30 Count(*)
10 5 20 3 30 4
The output in this forum is not proper but try to understand that the no. 5,3 & 4 should be below count(*) column and 10,20 & 30 should be below deptno.