I have the following SQL query, i need to convert it to HQl. Please give me some advice. I tried but failed to do so.
Code:
select * from (select t1.*,m.name from (select sa.id,sa.account_no,sa.member,ma.ADDRESS_LINE1,ma.ADDRESS_LINE2,ma.ADDRESS_LINE3,sa.sub_product from dbo.SAVING_ACCOUNT sa inner join dbo.MEMBER_ADDRESS ma on sa.member = ma.member where sa.STATUS<>'DELETE' and ma.MAILING_ADDRESS = 1) t1 inner join member m on t1.member = m.id) t4 inner join (select st.* from dbo.SAVING_TRANSACTION st inner join (select min(transaction_no) as txn_no,SAVING_ACCOUNT,MEMBER from dbo.SAVING_TRANSACTION group by member,saving_account) t3 on st.TRANSACTION_NO = t3.txn_no and st.member = t3.member) t5 on t4.id = t5.saving_account and t4.member = t5.member