当前位置:网站首页>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,
边栏推荐
猜你喜欢

不同的数据驱动代码执行相同的测试场景

Redis之发布订阅

LeetCode41——First Missing Positive——hashing in place & swap

Intel distiller Toolkit - Quantitative implementation 3

Kratos ares microservice framework (II)

Redis' bitmap

Reids之删除策略

Le modèle sentinelle de redis

Redis之Lua脚本
![[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth](/img/10/c0545cb34621ad4c6fdb5d26b495ee.jpg)
[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth
随机推荐
Pytest parameterization some tips you don't know / pytest you don't know
068.查找插入位置--二分查找
【图的三大存储方式】只会用邻接矩阵就out了
英雄联盟轮播图手动轮播
Multivariate cluster analysis
Mysql database recovery (using mysqlbinlog command)
Le modèle sentinelle de redis
IDS' deletion policy
Heap (priority queue) topic
[OC foundation framework] - [set array]
[three storage methods of graph] just use adjacency matrix to go out
Redis geospatial
为拿 Offer,“闭关修炼,相信努力必成大器
In depth analysis and encapsulation call of requests
requests的深入刨析及封装调用
xargs命令的基本用法
Withdrawal of wechat applet (enterprise payment to change)
Pytest参数化你不知道的一些使用技巧 /你不知道的pytest
Selenium+pytest automated test framework practice
Redis之主从复制