KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
database table like this ============================ = suburb_id | value = 1 | 2 = 1 | 3 = 2 | 4 = 3 | 5 query is SELECT COUNT(suburb_id) AS total, suburb_id FROM suburbs where suburb_id IN (1,2,3,4) GROUP BY suburb_id however, while I run this query, it doesn't give COUNT(suburb_id) = 0 when suburb_id = 0 because in suburbs table, there is no suburb_id 4, I want this query to return 0 for suburb_id = 4, like ============================ = total | suburb_id = 2 | 1 = 1 | 2 = 1 | 3 = 0 | 4
Tags (comma-separated)
Save Edits
Cancel