当前位置:网站首页>Leetcode:608 树节点
Leetcode:608 树节点
2022-07-06 09:01:00 【棱镜7】
一、code
1.1 题目描述
1.2 题解
# Write your MySQL query statement below
select
id,
case
when p_id is null then 'Root'
when id in (select distinct p_id from tree) then 'Inner' # 当not in() 里面包含null值,查询不会返回任何值。
else 'Leaf'
end as type
from
tree
order by id
;
二、总结
select case city_name
when ‘深圳’ THEN ‘华南’
when ‘广州’ THEN ‘华南’
when ‘佛山’ THEN ‘华南’
when ‘杭州’ THEN ‘华东’
when ‘上海’ THEN ‘华东’
ELSE ‘其他’
END AS temp,
边栏推荐
- KDD 2022 paper collection (under continuous update)
- Pytest parameterization some tips you don't know / pytest you don't know
- Redis之Bitmap
- Redis之发布订阅
- Kratos ares microservice framework (I)
- Redis之连接redis服务命令
- Kratos战神微服务框架(一)
- Reids之删除策略
- Kratos ares microservice framework (III)
- Advance Computer Network Review(1)——FatTree
猜你喜欢

An article takes you to understand the working principle of selenium in detail

软件负载均衡和硬件负载均衡的选择

Redis之核心配置

Selenium+pytest automated test framework practice (Part 2)

Activiti7工作流的使用

What is MySQL? What is the learning path of MySQL

Intel distiller Toolkit - Quantitative implementation 1

CUDA realizes focal_ loss

In depth analysis and encapsulation call of requests

Redis' bitmap
随机推荐
Post training quantification of bminf
Global and Chinese market of linear regulators 2022-2028: Research Report on technology, participants, trends, market size and share
The order of include header files and the difference between double quotation marks "and angle brackets < >
Redis分布式锁实现Redisson 15问
Advanced Computer Network Review(4)——Congestion Control of MPTCP
Kratos ares microservice framework (I)
Blue Bridge Cup_ Single chip microcomputer_ PWM output
Advanced Computer Network Review(3)——BBR
Redis connection redis service command
基于B/S的影视创作论坛的设计与实现(附:源码 论文 sql文件 项目部署教程)
在QWidget上实现窗口阻塞
BN folding and its quantification
Kratos战神微服务框架(三)
不同的数据驱动代码执行相同的测试场景
MapReduce工作机制
xargs命令的基本用法
Redis core configuration
Minio distributed file storage cluster for full stack development
QML control type: Popup
Advanced Computer Network Review(3)——BBR