Originally posted by Syed Saifuddin: hi Mark Spritzler
Thank You Mark Spritzler this really solve the big part of my problem. but 1 more thing is left
in start of query I say count(contact) as smscount and in last I write order by smscount desc.
If I dont put alias to the function how can I use order by
You just need to remember that JPA-QL is not SQL.
Try the alias again in the count and what happens. If you keep getting an error then you know you can't use that alias in the query and might just have to put the count() function call in the order by. Try them both out and see what happens.