एक LEFT JOIN
के साथ :
select t1.name Country, count(distinct t2.name) Count
from country t1 left join cities t2
on t2.name like concat('%, ', t1.name)
group by t1.name
डेमो
देखें .
परिणाम:
| Country | Count |
| ------- | ----- |
| France | 2 |
| Italy | 1 |
| USA | 2 |