this is my query
SELECT max(rev_no), max(tour), max(DT), max(SHIFT_NO), max(DECODE(STA,1,RD,NULL)) "MW PR",
max(DECODE(STA,2,RD,NULL)) "MW",
max(DECODE(STA,3,RD,NULL)) "MW D",
max(DECODE(STA,10,RD,NULL)) "P2300-4 PR",
max(DECODE(STA,11,RD,NULL)) "P2300-4",
max(DECODE(STA,12,RD,NULL)) "P2300-4 D"
FROM history WHERE tour=18 AND rev_no=1 AND DT={?SelectDate} GROUP BY SHIFT_NO ORDER BY SHIFT_NO
On database shift_no has 24 values 1,2,3,4,5,6,7,8,9,10,....24
It gives me all the data i want but gives only the rows where there is value of RD in differnt STA. For example there are values in RD when shift_no is 1,2,3,4,5. it gives me only five rows. What if i want to display all 24 rows and display values in only shift_no 1,2,3,4,5 and rest of the shift_no blank. how can i do that?
Thanks
SELECT max(rev_no), max(tour), max(DT), max(SHIFT_NO), max(DECODE(STA,1,RD,NULL)) "MW PR",
max(DECODE(STA,2,RD,NULL)) "MW",
max(DECODE(STA,3,RD,NULL)) "MW D",
max(DECODE(STA,10,RD,NULL)) "P2300-4 PR",
max(DECODE(STA,11,RD,NULL)) "P2300-4",
max(DECODE(STA,12,RD,NULL)) "P2300-4 D"
FROM history WHERE tour=18 AND rev_no=1 AND DT={?SelectDate} GROUP BY SHIFT_NO ORDER BY SHIFT_NO
On database shift_no has 24 values 1,2,3,4,5,6,7,8,9,10,....24
It gives me all the data i want but gives only the rows where there is value of RD in differnt STA. For example there are values in RD when shift_no is 1,2,3,4,5. it gives me only five rows. What if i want to display all 24 rows and display values in only shift_no 1,2,3,4,5 and rest of the shift_no blank. how can i do that?
Thanks