Re: Joining multiple tables
I have DONE IT!!!!
SELECT `company_name`, `address`, `phone_number`, (SELECT COUNT(*) FROM `client_contact` WHERE `client_company`.`id` = `client_contact`.`company_id`) as `contacts`, (SELECT COUNT(*) FROM `license` WHERE `client_company`.`id` = `license`.`company_id`) as `licenses` FROM `client_company` ORDER BY `id` DESC
I just wrote another SELECT inside a bracket which I did not know was possible. Gonna write it here IF any people need it.
Subject
Written By
Posted
Re: Joining multiple tables
March 02, 2020 07:26AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.