[LeetCode] 584. Find Customer Referee_Easy tag: SQL
2024-10-18 18:21:11
Given a table customer
holding customers information and the referee.
+------+------+-----------+
| id | name | referee_id|
+------+------+-----------+
| 1 | Will | NULL |
| 2 | Jane | NULL |
| 3 | Alex | 2 |
| 4 | Bill | NULL |
| 5 | Zack | 1 |
| 6 | Mark | 2 |
+------+------+-----------+
Write a query to return the list of customers NOT referred by the person with id '2'.
For the sample data above, the result is:
+------+
| name |
+------+
| Will |
| Jane |
| Bill |
| Zack |
+------+
note: 要用 is Null 和 != .
Code
SELECT name FROM customer WHERE referee_id != 2 OR referee_id IS NULL
最新文章
- PHP Redis 全部操作方法
- NUC_HomeWork1 -- POJ2067(最短路)
- JavaScript权威指南(第六版)--JavaScript概述 DEMO
- Java方法
- 《TCP/IP具体解释卷2:实现》笔记--IP多播
- python邮件发送接收
- c# label的内容显示不全
- usaco 打扫食槽
- php下正则表达式整理
- 开发一个Swing功能时的一点总结
- GDI+ 应用,Release没有错误,Debug很多。
- PHP扩展开发 第一课 为什么要写扩展及hello world
- MoonLight可视化订单需求区域分析系统前端
- Cocos2D遍历场景图(Scene Graph)
- Flack--SQLAlchemy
- nginx 重定向 说明
- POJ 1094 Sorting It All Out 【拓扑排序】
- SpringBoot项目单元测试
- 图文转化(Alpha)版使用说明
- iml文件
热门文章
- 180714、JRebel插件安装配置与破解激活(多方案)详细教程
- Python----八荣八耻
- Windows的文件类型关联
- Entity Framework Core的贴心:优雅处理带默认值的数据库字段
- Ubuntu下eclipse中运行Hadoop时所需要的JRE与JDK的搭配
- TensorRT 不支持Tensorflow的操作有如下
- zookeeper集群扩容/下线节点实践
- windows共享文件分析
- [development][c++] C++构造函数调用构造函数
- Nand Flash 驱动框架