Home » SQL & PL/SQL » SQL & PL/SQL » SQL doubt
SQL doubt [message #249180] Tue, 03 July 2007 10:30 Go to next message
rsreddy28
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

DATE TOTAL

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

Regards,

Raj
Re: SQL doubt [message #249188 is a reply to message #249180] Tue, 03 July 2007 10:44 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Search for "pivot".
This one is closed.
./fa/448/0/
Regards
Michel
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: Sat Dec 10 14:45:43 CST 2016

Total time taken to generate the page: 0.08420 seconds