How do i convert the below SQL query into HQL query without using IN
select a.*,b.*,c.* from table1 a,table2 b,table3 c,(select max(id) as id from table1 group by id1,id2) as d where d.col1=a.col1 and b.col1=a.col2 and c.col1=a.col3 and a.col4=? and a.datecolumn between ? and ? order by a.datecolumn desc
I have tried the same with the NativeSQL (createSQLQuery), the problem i faced there is it is executing so many sub queries which i don't want to happen.
Please suggest me a solution to over come this problem
Please let me know for any further questions.
Thanks, Shan.....
|