How could I create a single query for all values from more than 1 tables where a county is equal to 'baawa'. I am using PHP to connect to the database.
What I tried:
SELECT (
SELECT * FROM health WHERE county='baawa'
),
(
SELECT * FROM hotspots WHERE county='baawa'
),
(
SELECT * FROM markets WHERE county='baawa'
),
(
SELECT * FROM schools WHERE county='baawa'
),
(
SELECT * FROM security WHERE county='baawa'
)
Edit: The tables have different number of columns.
Tables columns:
Health facility_id, name, ward, location, lat, lon, staff, staff_category, structure, emergencies, conflict_cases, communication_facility, power
Hotspots name, lat, lon, ward, location, mgt_committee, security, type
Market market_id, name, ward, location, lat, lon, mgt_committee, security
Schools Full texts, school_id, name, level, ward, location, lat, lon, students, staff_no, peace_club, conflict_affected
Security security_id, name, ward, location, lat, lon, staff, structure, transport, communication, power, crimes, resolutions