I've run into trouble when writing a query to retrieve data from 3 tables as below the error message comes up when clicking on the add page..
"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'left join ( select company, count(counting) as count from child group b' at line 4"
SELECT
brigade_id.company_name, a.count, b.leaders
from brigade_id
left join (
select company, count(counting) as count
from child
group by company
) a on brigade_id.company_name=a.company
left join(
select company, count(counting) as leaders
from leader1
group by company
) b on brigade_id.company_name=b.company
I've tried various ways but I still get the same error message?
Would anyone be able to assist please?
Thank you.