I’m having a bit of headache with some SQL I’m trying to write. Basically, there’s 2 tables that have the following fields (only relevant ones to SQL displayed):
Invoices
accno (fk, linked to id on accounts)Accounts
id (pk) allocateduser
Basically, my SQL needs to return all invoices for which account has their current logged in name as the AllocatedUser, which is stored in a Session. Is this simple to do?
Thanks
You can look up all accounts for a user with a
wherestatement, and link the result to the invoices table with ajoin. For example: