I have the following query, which I designed to compile data from a number of views based on client data.
SELECT
vw_clients.client_id,
name,
exts,
vms,
ivrs,
queues,
conf10,
conf20,
conf30
FROM
vw_clients,
vw_exts,
vw_vms,
vw_ivrs,
vw_queues,
vw_conf10,
vw_conf20,
vw_conf30
WHERE
vw_clients.client_id = vw_exts.client_id AND
vw_clients.client_id = vw_vms.client_id AND
vw_clients.client_id = vw_ivrs.client_id AND
vw_clients.client_id = vw_queues.client_id AND
vw_clients.client_id = vw_conf10.client_id AND
vw_clients.client_id = vw_conf20.client_id AND
vw_clients.client_id = vw_conf30.client_id;
The query works fine so long as there are records in every view relating to the records in vw_clients. However I need to modify this to use a left join, so that it returns all records from vm_clients and only those from the other views that have records for those clients.
I've read about left joins, but at most I have only found info on joining one or maybe two tables - but I need to join 8. Do I do a left join on vw_clients.client_id to the corresponding client_id field in all of the views? What's the syntax for that?
Would be grateful for any help. I'm very close to solving this issue and I think this is the last piece of the puzzle!
Many thanks.
... left join on <condition> ...
).