MySQL Forums
Forum List  »  InnoDB

Error: invalid use of group function
Posted by: V. K. Prince
Date: June 16, 2005 01:48AM

I have a table fund with fields Balance, id, ReqCount

For each id there should be more than one record
I want to display the record with ReqCount=max(ReqCount) group by id

Im using mysql and my version is not supporting subquery
i have tried with the query as

select Balance, id, ReqCount from fund where id='200010006' and ReqCount=max(ReqCount) group by id

but it is showing error 'invalid use of group function'

is there any other way to do that with out selecting more than one record for each id..
[ie, it is possible to select all records sort by ReqCount desc and take the first record]

but i dont want that, is there any other way..
pls help me...
its an urgent work to complete...

pls reply anybody...

thanx in advance


Options: ReplyQuote

Written By
Error: invalid use of group function
June 16, 2005 01:48AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.