I have a table called USERS from which I'm getting an employee's first and last name, and printing them out as one name. How do I use ORDER BY correctly on this data?
Here's what I have:
SELECT l.OFFICE_NAME, (us.LAST_NAME || ' , ' || us.FIRST_NAME) AS "Employee Name"
FROM LOCAL_OFFICE l, USERS us
WHERE l.LOCAL_OFFICE_ID = us.LOCAL_OFFICE_ID
ORDER BY l.OFFICE_NAME --what do I place here?--
I will do this through a JOIN instead of the more expensive FROM, but how do I order by the name alphabetically?
You can say:
ORDER BY office_name, "Employee Name"
That works in 11G, but maybe not in older version of Oracle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With