05 2023 档案

sql---判断语句
摘要:![](https://img2023.cnblogs.com/blog/771659/202305/771659-20230519180113814-1926216148.png) ###将条件看做三种情况,分别处理 ```sql SELECT CASE WHEN id % 2=1 and id= 阅读全文

posted @ 2023-05-19 18:05 新freedom 阅读(75) 评论(0) 推荐(0) 编辑

sql---partition的使用
摘要:###partition分组函数,简化分组 原来语句 select ROUND(SUM(TIV_2016),2) TIV_2016 from (select a.*,b.TIV_2015_count,c.LAT_LON_count from insurance a left join (select 阅读全文

posted @ 2023-05-17 13:05 新freedom 阅读(211) 评论(0) 推荐(0) 编辑

sql---排列函数
摘要:rank() && dense_rank() ###1.rank() 排名按照1,2,2,4,5,6 select score,rank() over(order by S.score desc) as "rank" from Scores S ###2.dense_rank() 排名按照1,2,2 阅读全文

posted @ 2023-05-16 13:49 新freedom 阅读(10) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示