Home » SQL & PL/SQL » SQL & PL/SQL » sql output into columns
sql output into columns [message #245692] Mon, 18 June 2007 09:18 Go to next message
mape
Messages: 241
Registered: July 2006
Location: Slovakia
Senior Member
Hi,

I would like to get result query into the the desired view.
Exactly I got these select:


SELECT comp_reg_no COMP, ROUND (behav_value, 2) B, MONTH,
      behav_value A
FROM accounts
where acntnum=123


The result is like that:

COMP  B    MONTH      A
------------------------
123  322   2007-01    3
123  324   2007-02    1
123  67578 2007-03    1




But I would like to do if every month would be as a new columns.
For example:
COMP  2007-01   2007-02    2007-03  A   A   A
--------------------------------------------- 
123   322        324       67578   3    1   1



Does anybody know how to do that?
thanks

Regards

Martin

[Updated on: Mon, 18 June 2007 09:19]

Report message to a moderator

Re: sql output into columns [message #245694 is a reply to message #245692] Mon, 18 June 2007 09:28 Go to previous messageGo to next message
shanthkumaar
Messages: 156
Registered: February 2007
Location: india,chennai
Senior Member

hi,

May be you can check for pivot
check this one too

regards
shanth
Re: sql output into columns [message #245767 is a reply to message #245692] Mon, 18 June 2007 13:37 Go to previous message
mape
Messages: 241
Registered: July 2006
Location: Slovakia
Senior Member
Hi

Thanks for advice. I gonna check this out.
I will let you know.

Best Regards,


Previous Topic: I want to send mail with attached document
Next Topic: How to access system owned tables fromScott/Tiger
Goto Forum:
  


Current Time: Sun Dec 11 02:05:40 CST 2016

Total time taken to generate the page: 0.15871 seconds