数据库力扣题从不订购的客户

 分析:题中给出两个表可得出应该是连接查询中的左连接。由条件从不订购任何东西的用户可得出应该用空值操作符,测试字段是否是空值。

答案:select Name as Customers from Customers left join Orders on Customers.Id=Orders.CustomerId where Orders.CustomerId is null

知识点:空值操作符可测试字段是否是空值,比较运算符只适用于条件表达式。

猜你喜欢

转载自www.cnblogs.com/laixiaobin/p/11653548.html