Joined: Wed Dec 06, 2006 10:52 pm Posts: 5
|
3.1.1
MySQL 5.0
Hi All,
I have a question on ordering while using left fetch join. I have two tables with a one-many relationship as follows :
table2.empId has a foreign key to table1.empId
table1.getEmpId() returns a collection of empId
table1
----------
empId
name
active
table2
----------
id
empId
showOrder
city
I do the following query
FROM Table1 AS tb1 LEFT JOIN FETCH tb1.empId WHERE tb1.active=1;
Now the question I have is - I need to order the elements (in ASC) returned by the previous query by table2.showOrder and table2.city. Can I accomplish this using LEFT JOIN FETCH or is there another easier way to do it ? Let me know
THanks
K
|
|