•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 391,550 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,565 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser:
Views: 1700 | Replies: 0
![]() |
•
•
Join Date: Apr 2006
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
Last edited by manoj201jain : Jul 29th, 2006 at 10:35 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Oracle Marketplace
- how to delete duplicate record in a table by using SQL query (MS SQL)
- sql query problem with MS Access and C# (C#)
- SQL query problem with WHERE clause (ASP)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Please help me out with MySQL query (MySQL)
- query problem (MySQL)
Other Threads in the Oracle Forum
- Previous Thread: Error 500 in internet browser
- Next Thread: Pbm with stored procedure


Linear Mode