1 Reply Latest reply on Dec 27, 2008 8:15 AM by mravikrish

    ejb aggregate functions problem

    mravikrish

      Hi,

      I am ramu. i am having a problem with group by clause.

      my entities are project and bid

      my query is

      SELECT distinct(p.projectId) FROM Project p JOIN p.bids b GROUP BY p HAVING COUNT(b) > 1

      the above query is returning projectid.

      but i want to get project object.

      for that i have tried like this but not working

      SELECT distinct(p) FROM Project p JOIN p.bids b GROUP BY p HAVING COUNT(b) > 1

      it is saying not a GROUP BY expression

      please help me its very urgent.

      Thanking You
      KRamu