Hi Guys,
I am newbie for using hibernate criteria queries
We have a applpication running and i have to make changes to existing criteria query
I know sql that will fetch me the reqd resultSet. But i dont know how to translate it to criteria
Below is my sql query
Code:
select h.employeeCode, h.yymm,sum(h.amount) as amt,COALESCE(d.lessamnt,0) from hist_sal h
left join
(select s.employeeCode as derivedempCode, sum(s.amount)as lessamnt from hist_sal s
where s.yymm between '200905' and '200908'group by s.employeeCode, s.yymm
)as d on d.derivedempCode = h.employeeCode and h.yymm between '200906' and '200907'
group by h.employeeCode, h.yymm ;
Its not that i am very new to criteria query but i cannot convert this above query in to criteria will you please help me for it. It will also me to understand concept of using subqueries in criteria