I am trying to change the SQL query below to HQL in my grails-groovy application
top10UserActivityQuery =
"select sum(trans_cnt) as t_cnt, employeeid as username from map2_data "+
"where fdate between (:datefrom) and (:dateto) and res_id=:res_id and location =:location "+
"group by employeeid order by t_cnt desc limit 10;"
der rows = myds.rows(top10UserActivityQuery )
How do I use the createcriteria in GORM for this..or any other way?
the criteria would be similar to the following:
however, i’d suggest using the direct hql this criteria generates.