I have a table ORD which has one BTN(0000000000). This BTN has 9 entries in the DTL table( 9 products associated to this BTN). I need to format the out put in this fixed length ONE LINE output:
BTN prod_count(9)nm1 nm2 nm3 nm4 nm5 nm6 nm7 nm8 nm9
NOTE: I put spaces between prods for readability purpose.
Here is the query whcih gives me all 9 pordcuts but in nine lines not on the same line.
select BTN
, prod_nm
from
( select ORD.BTN, PROD.PROD_NM
from ORD left outer join DTL
on ORD.ORD_ID=DTL.ORD_ID
inner join prod
on prod.prod_id=DTL.prod_id
where ORD.BTN='0000000000'
group by ORD.BTN, prod.PROD_NM) X
group by 1,2
order by 1,2
BTN PROD_NM
0000000000 NM1
0000000000 NM2
0000000000 NM3
0000000000 NM4
0000000000 NM5
0000000000 NM6
0000000000 NM7
0000000000 NM8
0000000000 NM9
Any suggestions?
Thanks,
DFW1999
BTN prod_count(9)nm1 nm2 nm3 nm4 nm5 nm6 nm7 nm8 nm9
NOTE: I put spaces between prods for readability purpose.
Here is the query whcih gives me all 9 pordcuts but in nine lines not on the same line.
select BTN
, prod_nm
from
( select ORD.BTN, PROD.PROD_NM
from ORD left outer join DTL
on ORD.ORD_ID=DTL.ORD_ID
inner join prod
on prod.prod_id=DTL.prod_id
where ORD.BTN='0000000000'
group by ORD.BTN, prod.PROD_NM) X
group by 1,2
order by 1,2
BTN PROD_NM
0000000000 NM1
0000000000 NM2
0000000000 NM3
0000000000 NM4
0000000000 NM5
0000000000 NM6
0000000000 NM7
0000000000 NM8
0000000000 NM9
Any suggestions?
Thanks,
DFW1999