Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> row merge
Hi,
Mabey I being stupid but, Does anyone know how to have the following sql merge the week rows so that there is only one row per week?
SQL> SELECT
2 ww.week,
3 substr(decode(us.shortname, 'Wn',ww.hours || '/' || ww.workweek
,null),1,15) as "Wn",
4 substr(decode(us.shortname, 'Hm',ww.hours || '/' || ww.workweek
,null),1,15) as "Hm"
5 from
6 v_workweek ww,
7 tabc_users us
8 where
9 ww.userid = us.id
10 and (ww.UserID = 127 or ww.UserID = 21609)
11 and ww.week >=
To_Char(To_Date('20020301000000','YYYYMMDDHH24MISS'),'YYYY/IW')
12 and ww.week <=
To_Char(To_Date('20020401112350','YYYYMMDDHH24MISS'),'YYYY/IW')
13 order by
14 ww.week;
WEEK Wn Hm
------- --------------- ---------------
2002/09 48.9/40 2002/09 38.8/40 2002/10 44.7/40 2002/10 41.3/40 2002/11 56.7/40 2002/11 38.3/40 2002/12 44.6/40 2002/12 39.8/40 2002/13 24.7/32
Many Thanks Received on Thu Apr 11 2002 - 06:41:46 CDT
![]() |
![]() |