How can you do a Order by based on having a query on multiple tables?
I am using MySQL 3.22.28 as my database...
When I use this code WITHOUT the Order by, I get records, so it works...
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
When I order by any field in ADPE, I get records...
but when I try to Order by a field that isn't from ADPE the Order by doesn't work...
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
Order By Location.MEDL_No
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
Order By equipment.MEDL_No
Can any one help with this order by problem.... I am trying to have an order by where it allows the user to order by any table field and have an order by where the fields listed in the order by can also be from different tables.... is that possible....
I am using MySQL 3.22.28 as my database...
When I use this code WITHOUT the Order by, I get records, so it works...
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
When I order by any field in ADPE, I get records...
but when I try to Order by a field that isn't from ADPE the Order by doesn't work...
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
Order By Location.MEDL_No
Select ADPE.*, equipment.*, Location.*
FROM ADPE, equipment, Location
WHERE ADPE.MEDL_No = equipment.MEDL_No and ADPE.MEDL_No = Location.MEDL_No
Order By equipment.MEDL_No
Can any one help with this order by problem.... I am trying to have an order by where it allows the user to order by any table field and have an order by where the fields listed in the order by can also be from different tables.... is that possible....