Home » SQL & PL/SQL » SQL & PL/SQL » SQL doubt
SQL doubt [message #249180] Tue, 03 July 2007 10:30 Go to next message
Messages: 295
Registered: May 2007
Senior Member
Hello All,

I'm working on Oracle 9i . I'm using a query like

SQL> select hiredate(to_char(hiredate,'yy') DATE ,count(*)TOTAL from emp
group by to_char(hiredate,'yy');

Now my output is


80 1
81 10
82 1
83 2.

But I want the output to be in the below mentioned format :

80 81 82 83

1 10 1 2.

Can somebody help me in that plz with the syntax.I dont know how to use pivot function. so plz with the syntax


Re: SQL doubt [message #249188 is a reply to message #249180] Tue, 03 July 2007 10:44 Go to previous message
Michel Cadot
Messages: 65135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Search for "pivot".
This one is closed.
Previous Topic: how to transpose the rows in oracle
Next Topic: Using WHERE to SELECT when records are contained in another table
Goto Forum:

Current Time: Wed Aug 16 18:51:24 CDT 2017

Total time taken to generate the page: 0.10263 seconds