|
Deon Smit
Starting Member
47 Posts |
Posted - 2008-11-20 : 01:32:20
|
| HiI have figured out how to select Rows as columns per item as rows and stock per warehouse.But the thing is. I have 45 warehouses starting at 301, 302 ,303 ......How can I modify my script so that I don't have to do this 45 times. I only dit it 7 times in my scripts. Please help.SELECT * FROM (SELECT T$ITEM, sum(decode(T$CWAR,301,T$STOC,0)) WAR301, sum(decode(T$CWAR,302,T$STOC,0)) WAR302, sum(decode(T$CWAR,303,T$STOC,0)) WAR303, sum(decode(T$CWAR,304,T$STOC,0)) WAR304, sum(decode(T$CWAR,305,T$STOC,0)) WAR305, sum(decode(T$CWAR,306,T$STOC,0)) WAR306, sum(decode(T$CWAR,307,T$STOC,0)) WAR307, sum(decode(T$CWAR,308,T$STOC,0)) WAR308, sum(T$STOC) TOTAL FROM baandb.ttdinv001700 GROUP BY T$ITEM)ORDER BY 1; |
|