多表关联,有则显示,无则返回0或者''

今天在LeetCode上刷题的时候看到下面这道题 题目倒不是很难,主要是这道题让我回想起了我在工作中碰到的两个场景,这道题的解法如下: select c.Name as Customers from Customers as c where c.Id not in (select CustomerId from Orders) 我去年在工作中有碰到这样一个场景,还是拿这张表为例,要求展示出用户名,
相关文章
相关标签/搜索