| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Difficult SQL Please Help
I've been at this for quite a while, I'm so close yet so far.........
The Statement Below Works Just Fine With The 3.92 Hard Coded In, However I Need To Replace The 3.92 With The Statement Fragment (also below). When I Add The Statement Fragment I Get The Error: ORA-00937: not a single-group group function
If I remove the Sum() From the Fragment, The Query Will Run, But I Get Incorrect Results.
HERE IS THE STATEMENT: SELECT
READING_DATE AS READ_DATE,
MIN(reading_time) AS READ_TIME,
SUM(DECODE(INSTRUMENT_NAME, 'P001', (3.92 / ((DECODE(HEADWATER -
TAILWATER, 0, NULL,(HEADWATER-TAILWATER))) / 100)))) AS "P001 DELTA_HEAD",
LOC_CODE
FROM
PIEZ.P_READINGS R1
Thanks,
Sean Harasin
sharsin_at_mbakercorp.com
Received on Sun Feb 20 2000 - 11:23:28 CST
![]() |
![]() |