惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
U
Unit 42
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
D
DataBreaches.Net
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog RSS Feed
J
Java Code Geeks
The GitHub Blog
The GitHub Blog

博客园 - chenzechao

时间复杂度汇总对比表 GROUP BY + 窗口嵌套聚合(单层 SQL,不嵌套子查询) SQL rename 语法 macOS SecureCRT 外接小键盘回车失效完整修复 Windows 11 首次开机引导(OOBE 阶段)跳过登录微软账户,创建本地账户 Claude Code Skill 突然「用不了」 HomeAssistant 安装HACS MacOS系统GPU占用高 edge 抓取 DNS 解析记录 router iStoreOS mysql starrocks json处理 json遍历数组所有元素 git复制指定提交到其他分支 secureCrt标签页固定 mac键盘 vs code settings.json 拉链表匹配筛选日期区间 StarRocks中CTE报错 shell 循环遍历的详细用法 shell变量带默认值配置 cursor自动执行 JDK17生成JRE环境 Alt+Tab切换窗口时不包括网页窗口 mysql变量使用 maven工程改版本号,支持多模块一次性修改 mysql取中位数、p80、p90 IDEA常用快捷键 Linux环境使用上下方向键无法查看history历史记录问题解决方法 博文阅读密码验证 - 博客园 linux设置http proxy flask框架在本机可访问,而其它机子访问不了
SQL自定义排序
chenzechao · 2025-07-08 · via 博客园 - chenzechao
-- 自定义排序
select
     FIND_IN_SET(str, 'a,b,c,d,e') as str_fis
    ,str
from (
    select 'b' as str union all
    select 'a' as str union all
    select 'd' as str union all
    select 'c' as str union all
    select 'f' as str union all
    select 'g' as str union all
    select 'e' as str
) t1
order by str_fis
;

image

注意点

只支持可以穷举出来的,如不在范围内,则为0,会排在最前,不支持排在最后。