当前位置:网站首页>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,
边栏推荐
- CUDA implementation of self defined convolution attention operator
- leetcode-14. Longest common prefix JS longitudinal scanning method
- 一篇文章带你了解-selenium工作原理详解
- Redis之Lua脚本
- 有软件负载均衡,也有硬件负载均衡,选择哪个?
- Pytest参数化你不知道的一些使用技巧 /你不知道的pytest
- QML control type: menu
- 工作流—activiti7环境搭建
- Publish and subscribe to redis
- Selenium+Pytest自动化测试框架实战
猜你喜欢
Redis之Lua脚本
[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth
[three storage methods of graph] just use adjacency matrix to go out
Redis分布式锁实现Redisson 15问
Intel distiller Toolkit - Quantitative implementation 3
Redis之持久化实操(Linux版)
Blue Bridge Cup_ Single chip microcomputer_ Measure the frequency of 555
QDialog
CUDA implementation of self defined convolution attention operator
Selenium+pytest automated test framework practice
随机推荐
一改测试步骤代码就全写 为什么不试试用 Yaml实现数据驱动?
Implement window blocking on QWidget
LeetCode41——First Missing Positive——hashing in place & swap
Global and Chinese market of appointment reminder software 2022-2028: Research Report on technology, participants, trends, market size and share
The five basic data structures of redis are in-depth and application scenarios
CSP student queue
Nacos installation and service registration
Parameterization of postman
Booking of tourism products in Gansu quadrupled: "green horse" became popular, and one room of B & B around Gansu museum was hard to find
Design and implementation of film and television creation forum based on b/s (attached: source code paper SQL file project deployment tutorial)
leetcode-14. Longest common prefix JS longitudinal scanning method
MapReduce工作机制
为拿 Offer,“闭关修炼,相信努力必成大器
CSP salary calculation
Advanced Computer Network Review(4)——Congestion Control of MPTCP
Withdrawal of wechat applet (enterprise payment to change)
在QWidget上实现窗口阻塞
[oc]- < getting started with UI> -- common controls - prompt dialog box and wait for the prompt (circle)
Global and Chinese market of metallized flexible packaging 2022-2028: Research Report on technology, participants, trends, market size and share
Redis分布式锁实现Redisson 15问