dbTalk Databases Forums  

Please help while I still have hair

comp.database.oracle comp.database.oracle


Discuss Please help while I still have hair in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
none_ya
 
Posts: n/a

Default Please help while I still have hair - 01-02-2004 , 02:40 AM






when I enter:
SELECT
INV_TRANSACTION.ITEM||'|'||INV_TRANSACTION.TRANS_D ATE||'|'||INV_TRANSACTION.
FROM_WHS_CODE||'|'||WAREHOUSE.WHS_NAME||'|'||SUM(I NV_TRANSACTION.QUANTITY)
FROM ABC.INV_TRANSACTION INV_TRANSACTION, ABC.WAREHOUSE WAREHOUSE
WHERE WAREHOUSE.WHS_CODE = INV_TRANSACTION.FROM_WHS_CODE
AND INV_TRANSACTION.TRANS_DATE >=
TO_DATE('20031222000000','YYYYMMDDHH24MISS')
AND INV_TRANSACTION.TRANS_DATE <=
TO_DATE('20031228000000','YYYYMMDDHH24MISS')
AND INV_TRANSACTION.FROM_WHS_CODE = '5599AAA'
AND INV_TRANSACTION.ITEM = '797553001'
AND INV_TRANSACTION.TRANS_CODE = 'SI' AND INV_TRANSACTION.QUANTITY > 0
GROUP BY INV_TRANSACTION.ITEM, INV_TRANSACTION.TRANS_DATE,
INV_TRANSACTION.FROM_WHS_CODE, WAREHOUSE.WHS_NAME
ORDER BY INV_TRANSACTION.TRANS_DATE ASC;
I get:

INV_TRANSACTION.ITEM||'|'||INV_TRANSACTION.TRANS_D ATE||'|'||INV_TRANSACTION.
FROM_WHS_CODE||'|'||WARE
---------------------------------------------------------------------------
-------------------------
797553001|22-DEC-03|5599AAA|Big Store-Sellable Inventory|5
797553001|23-DEC-03|5599AAA|Big Store-Sellable Inventory|5
797553001|26-DEC-03|5599AAA|Big Store-Sellable Inventory|20
797553001|27-DEC-03|5599AAA|Big Store-Sellable Inventory|1
what I really want is the Standard Deviation for the period so, I tried to
modified the SUM(INV_TRANSACTION.QUANTITY) to be
STDDEV(SUM(INV_TRANSACTION.QUANTITY) ) and get:
ERROR at line 1:
ORA-00937: not a single-group group function
I figured it was missing an order by, so I added:
ORDER BY stddev(SUM(INV_TRANSACTION.QUANTITY)) ASC
at the end of the line.
but now I get:
*
ERROR at line 10:
ORA-00935: group function is nested too deeply
I'm pullling my hair out. I see the data I want (5,5,20,1) and I know the
Stddev works - but some some reason the Oracle gods only know... I am
missing
this one completely!! Please help!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.