Home » SQL & PL/SQL » SQL & PL/SQL » Please Help Me
Please Help Me [message #197283] Tue, 10 October 2006 20:54 Go to next message
starfruit
Messages: 8
Registered: October 2006
Location: Ha Noi
Junior Member
I have a question.
when i excute the Query
********************************
select aud.auction_id,
aud.txn_term
* DECODE (aud.txn_term_unit, 1, 1, 2, 30, 3, 360)
|| ' Ngay' au_time_trans
FROM om_auction_detail aud order by aud.auction_id
***********************************************
The result return:
AUCTION_ID AU_TIME_TRANS

TBTTM00225 0 Ngay
TBTTM00225 0 Ngay
TBTTM01401 20 Ngay
TBTTM01401 20 Ngay
TBTTM01402 0 Ngay
TBTTM01402 0 Ngay
TBTTM01419 0 Ngay
TBTTM01431 5 Ngay
TBTTM01431 5 Ngay
TBTTM01431 5 Ngay
TBTTM01453 20 Ngay
TBTTM01454 0 Ngay
TBTTM01455 30 Ngay
TBTTM01455 60 Ngay
TBTTM01471 20 Ngay
TBTTM01471 30 Ngay
TBTTM01474 20 Ngay
TBTTM01474 30 Ngay
TBTTM01475 30 Ngay
TBTTM01475 60 Ngay
TBTTM01476 0 Ngay
TBTTM01476 0 Ngay
TBTTM01478 30 Ngay
TBTTM01478 30 Ngay
TBTTM01478 30 Ngay
TBTTM01491 0 Ngay

So Now I want output like this (distinct AUCTION_ID in vertical and concat all AU_TIME_TRANS distinct AUCTION_ID. Hence I want the result like this

AUCTION_ID AU_TIME_TRANS

TBTTM00225 0 Ngay, 0 Ngay
TBTTM01401 20 Ngay, 20 Ngay
TBTTM01402 0 Ngay, 0 Ngay
TBTTM01419 0 Ngay
TBTTM01431 5 Ngay, 5 Ngay, 5 Ngay
TBTTM01453 20 Ngay
TBTTM01454 0 Ngay
TBTTM01455 30 Ngay, 60 Ngay
TBTTM01471 20 Ngay, 30 Ngay
TBTTM01474 20 Ngay, 30 Ngay
TBTTM01475 30 Ngay, 60 Ngay
TBTTM01476 0 Ngay, 0 Ngay
TBTTM01478 30 Ngay, 30 Ngay, 30 Ngay
TBTTM01491 0 Ngay


Please advise.

Regards,

Re: Please Help Me [message #197315 is a reply to message #197283] Tue, 10 October 2006 23:43 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
http://www.williamrobertson.net/reframe.html?documents/one_row.html
Re: Please Help Me [message #197348 is a reply to message #197283] Wed, 11 October 2006 00:48 Go to previous message
starfruit
Messages: 8
Registered: October 2006
Location: Ha Noi
Junior Member
Thanks Barbara Boehmer That all I want
Previous Topic: password value
Next Topic: Does "Case when" can use at where clause
Goto Forum:
  


Current Time: Sat Dec 10 16:51:19 CST 2016

Total time taken to generate the page: 0.07535 seconds