让我们假设2(简化)表格,用户和住宅:
id | firstname
1 | Charles
2 | Frank
3 | Mark
user_id | city
1 | London
3 | Paris
select firstname, house.city
from user
left join house on user.id = house.user_id;
宣布列城市" DEFAULT NULL&#34 ;;结果是:
firstname | city
Charles | London
Frank | NULL
Mark | Paris
此结果存储在另一个表
中在此表中,稍后,我想测试" city is null"但我必须测试" city =' NULL' "
那么如何在没有匹配的情况下强制左连接设置实数空值?