SELECT t1.id, t1.name, t1.population, CAST(SUM(t2.town_1) AS CHAR) AS town, CAST(SUM(CASE WHEN t2.id LIKE 23 THEN 1 ELSE 0 END) AS CHAR) AS population FROM area1 t1 LEFT JOIN area2 t2 ON t1.id = t2.id WHERE t1.id like 23
通常,如果两个表中都存在 id = 23,它将匹配。但事实并非如此(不在 t1 表中),因此请求返回 NULL 值。
我该怎么做才能不返回结果?