1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/寻找用户推荐人 [find-customer-referee].html
2022-03-29 12:43:11 +08:00

30 lines
662 B
HTML

<p>给定表 <code>customer</code> ,里面保存了所有客户信息和他们的推荐人。</p>
<pre>
+------+------+-----------+
| id | name | referee_id|
+------+------+-----------+
| 1 | Will | NULL |
| 2 | Jane | NULL |
| 3 | Alex | 2 |
| 4 | Bill | NULL |
| 5 | Zack | 1 |
| 6 | Mark | 2 |
+------+------+-----------+
</pre>
<p>写一个查询语句,返回一个客户列表,列表中客户的推荐人的编号都 <strong>不是 </strong>2。</p>
<p>对于上面的示例数据,结果为:</p>
<pre>
+------+
| name |
+------+
| Will |
| Jane |
| Bill |
| Zack |
+------+
</pre>