Suppose,
We have a table emp(empid, empname, mgrid).
I want to display result like empid, empname, mgrname.
This is a sql query to generate this result :-
select e.empid, e.empname, (select m.empname from emp m where m.empid=e.mgrid) as mgrname from emp e;
Please, tell how to execute this query though createQuesry()/createSQLQuesry().
explanationramu October 14, 2011 at 7:43 PM
explanation is also required for the examples
How to execute following SQL query in hibernateVishwajit January 13, 2012 at 3:28 PM
Suppose, We have a table emp(empid, empname, mgrid). I want to display result like empid, empname, mgrname. This is a sql query to generate this result :- select e.empid, e.empname, (select m.empname from emp m where m.empid=e.mgrid) as mgrname from emp e; Please, tell how to execute this query though createQuesry()/createSQLQuesry().
Excelent example!John May 29, 2012 at 11:48 PM
Thanks for this example!
Post your Comment