当前位置:网站首页>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,
边栏推荐
- Kratos战神微服务框架(二)
- CUDA realizes focal_ loss
- Redis connection redis service command
- Sentinel mode of redis
- Redis之Lua脚本
- Seven layer network architecture
- Global and Chinese market of electronic tubes 2022-2028: Research Report on technology, participants, trends, market size and share
- Opencv+dlib realizes "matching" glasses for Mona Lisa
- Global and Chinese markets for modular storage area network (SAN) solutions 2022-2028: Research Report on technology, participants, trends, market size and share
- [OC foundation framework] - string and date and time >
猜你喜欢
英雄联盟轮播图自动轮播
基于B/S的医院管理住院系统的研究与实现(附:源码 论文 sql文件)
Intel distiller Toolkit - Quantitative implementation 2
In depth analysis and encapsulation call of requests
Multivariate cluster analysis
Advanced Computer Network Review(5)——COPE
[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth
Redis core configuration
Servlet learning diary 7 -- servlet forwarding and redirection
Sentinel mode of redis
随机推荐
数据建模有哪些模型
Redis' performance indicators and monitoring methods
CSP student queue
Withdrawal of wechat applet (enterprise payment to change)
Redis之发布订阅
基于B/S的网上零食销售系统的设计与实现(附:源码 论文 Sql文件)
Advance Computer Network Review(1)——FatTree
Solve the problem of inconsistency between database field name and entity class attribute name (resultmap result set mapping)
LeetCode41——First Missing Positive——hashing in place & swap
Selenium+pytest automated test framework practice
Kratos战神微服务框架(三)
Redis cluster
英雄联盟轮播图手动轮播
What is MySQL? What is the learning path of MySQL
Intel distiller Toolkit - Quantitative implementation 2
Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
Selenium+Pytest自动化测试框架实战
068.查找插入位置--二分查找
Pytest parameterization some tips you don't know / pytest you don't know
Global and Chinese market of electronic tubes 2022-2028: Research Report on technology, participants, trends, market size and share