Given the following two tables;
table1:
id
name
table2:
table1_id
How can i do a select which returns all names from table1 and a count of how
many relations there is in table2?
When I do
SELECT table1.name, count(table2.table1_id)
FROM table1, table2
WHERE table1.id = table2.table1_id
it works except I don't get the names of those without a relation in table2.
I would like to have them listed as well with 0 relations.
It's just takes too long to do the count for each row as I do now.
--
Bjørn Frantzen