group function is not allowed here [message #143322] |
Wed, 19 October 2005 21:36  |
janesddl
Messages: 3 Registered: October 2005
|
Junior Member |
|
|
do anyone hav any idea how to reconstruct the select statement as i'm hitting the error ORA-00934: group function is not allowed here. I have checked the oracle error message, suggesting me to remove the max and including the function in a subquery or having clause. But i've no idea where to start it.
Quote: | SELECT lm.CustID,
ld.dname,
MAX(lm.Created_date),
(SELECT lm2.App
FROM Log_master lm2
WHERE (lm2.Created_date = MAX(lm.Created_date) AND
lm2.CustID = lm.CustID)
AND rownum <= 1)
FROM Log_master lm
INNER JOIN Log_details ld ON lm.CustID = ld.winID
WHERE lm.Created_date >= systimestamp
AND lm.Level_check = 1
GROUP BY lm.CustID,
ld.dname
ORDER BY ld.dname
|
TQ
|
|
|
Re: group function is not allowed here [message #143332 is a reply to message #143322] |
Wed, 19 October 2005 23:51   |
kiran
Messages: 503 Registered: July 2000
|
Senior Member |
|
|
Quote: | (SELECT lm2.App
FROM Log_master lm2
WHERE (lm2.Created_date = MAX(lm.Created_date) AND
lm2.CustID = lm.CustID)
|
You are not suppose to use group functions in where cluase.Thats what is causing the error.
If possible post your tables definition and desired output , that will help us.
--Kiran.
|
|
|
|