I'm using PostgreSQL.
I have a table for a customers booking, Folio, that shows the staff ID of the staff that created the booking, and the ID of the most recent staff to change this booking.
I want to be able to, instead of showing these ID's, change them to show the name of the staff from my Staff table.
The fields in these tables are:
FOLIO:
CREATE_STAFF_ID, CHANGE_STAFF_ID
STAFF:
STAFF_ID, NAME
I've been trying something like:
SELECT (c.fields), p.CREATE_STAFF_ID, p.CHANGE_STAFF_ID, s.NAME
FROM OTHERTABLE c
JOIN FOLIO p ON (JOINING OTHERTABLE TO FOLIO TABLE)
JOIN STAFF s ON (p.CREATE_STAFF_ID = s.ALL_STAFF_ID)
WHERE (FILTERING);