I have two tables – the first table I am trying to get the total count for a city. On the second I am trying to get the total count for single-family homes. Basically I want the total count of single family homes for a city that are active and published. How do I join these two tables?
This first option works for total count of city
SELECT sum(case when city_id = ‘4’ then 1 else 0 end) ”
FROM #_property
WHERE status_id =7 AND published =1
On the second option works for the total count of single-family homes
SELECT sum(case when property_type_id = ’13’ then 1 else 0 end) ”
FROM #_property_types
I have no idea on how to get both tables to join.