我有一个名为all_countries的表1,内容如下-
id | country
------------------
1 | USA
2 | China
3 | India
4 | France
5 | UK
6 | Australia
而且我还有第二个表格,名为supported_countries -
id | country
------------------
1 | USA
2 | China
现在我需要一个查询,该查询将给出包括所有不受支持的国家在内的结果
因此,根据上面的示例,我应该得到
India
France
UK
Australia
我正在使用以下查询 -
SELECT ac.country FROM all_countries ac LEFT JOIN supported_countries sc ON sc.country_name = ac.country_name WHERE sc.country_name IS NULL
它运行良好,但当supported_countries表为空时,它不显示任何记录。如何实现这个结果?