I have the folowing query
select dated,sum(substr(hrs,1,2)) ||':'|| sum(substr(hrs,4,5)) hrs,dpt,reason
from dpr.stp_00_00
group by dated,dpt,reason
order by dated
Returning:
DATED HRS DPT REASON
10/14/2011 2:5 Mechanical Boiler tubes damaged & less availability of steam
10/14/2011 0:20 Mechanical Breakage of link of bagasse carrier # 1 and surplus
10/14/2011 1:0 Mechanical Choke at belt conveyor
10/15/2011 0:10 Mechanical Boiler pressure dropped
10/16/2011 1:30 Electrical Power failure / 505 governor card damaged of
10/16/2011 0:10 Mechanical 3rd mill taken in line
10/16/2011 0:30 Mechanical Raw juice line before primary heaters busted
10/16/2011 1:0 Mechanical Raw juice pump at mill house NRV body got busted
Problem in this query is that i want to show all reason in each date in single row so that all reason should be shown in single row against single date For example for the 14-OCT-2012 there are three reasons with same dept and same date i want to group also the reason so that it will shown in single row like
Dated HRS DPT Reason
10/14/2012 2:5 Mechanical All Resons of all 14 oct
Anyone please tell me how can i do this using sql query or any user defined function