Home » SQL & PL/SQL » SQL & PL/SQL » to get record in a single row
to get record in a single row [message #241690] Wed, 30 May 2007 07:28 Go to next message
durai
Messages: 38
Registered: December 2006
Member
hai friends,

i had a table with 3 columns with table name report

code amount tax
----- ------- ---
01 10000 10
02 2000 2
01 5000 5
01 12000 12
02 20000 20


is it possible to diplay the count of amount belongs to 01 and 02 in a single row, i tried in decode but i am not able to do it

is there any other way to do this


thanks in advance
Re: to get record in a single row [message #241698 is a reply to message #241690] Wed, 30 May 2007 07:50 Go to previous messageGo to next message
shanthkumaar
Messages: 156
Registered: February 2007
Location: india,chennai
Senior Member

hi,

check this one

regards
shanth
Re: to get record in a single row [message #242059 is a reply to message #241698] Thu, 31 May 2007 09:10 Go to previous messageGo to next message
durai
Messages: 38
Registered: December 2006
Member
sir i don't need to get the value in a double row

i want to get the result as

amount(01)  tax(01)  amount(02)  tax(02)
---------   -------  ----------  -------
27000        27        22000        22


[mod-ed]added [CODE] and [/CODE] tags.

[Updated on: Thu, 31 May 2007 09:12] by Moderator

Report message to a moderator

Re: to get record in a single row [message #242075 is a reply to message #242059] Thu, 31 May 2007 09:35 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Answer is in the link already posted.
There are many others as this is a question asked at least once each week.

Just search for "pivot".

Regards
Michel

[Updated on: Thu, 31 May 2007 09:36]

Report message to a moderator

Previous Topic: Equivalent datatypes in oracle
Next Topic: CLOB processing taking up large area in temp tablespace
Goto Forum:
  


Current Time: Sun Dec 11 02:17:28 CST 2016

Total time taken to generate the page: 0.07208 seconds