相关文章推荐
怕考试的木耳  ·  软件分享库合集链接汇总推荐_蓝奏云软件分享链 ...·  5 月前    · 
精明的日记本  ·  江西省发布第三批非法集资严重失信人名单 ...·  1 年前    · 
奔放的梨子  ·  Creating Word ...·  2 年前    · 
奔跑的苦咖啡  ·  地藏菩萨本愿经讲记(第十三卷)·  2 年前    · 
愤怒的菠萝  ·  异兽魔都(林田球创作的系列漫画)_搜狗百科·  2 年前    · 
Code  ›  [760]sqllite中实现字符串分割开发者社区
https://cloud.tencent.com/developer/article/1584248
耍酷的抽屉
2 年前
作者头像
周小董
0 篇文章

[760]sqllite中实现字符串分割

前往专栏
腾讯云
备案 控制台
开发者社区
学习
实践
活动
专区
工具
TVP
文章/答案/技术大牛
写文章
社区首页 > 专栏 > python前行者 > 正文

[760]sqllite中实现字符串分割

发布 于 2020-02-17 08:03:39
1.5K 0
举报

sqlite 从固定字符串分隔

WITH split(word, str) AS (
    -- alternatively put your query here
    -- SELECT '', category||',' FROM categories
    SELECT '', 'Auto,A,1234444,dsfdd,sd,sd,77'||','
    UNION ALL SELECT
    substr(str, 0, instr(str, ',')),
    substr(str, instr(str, ',')+1)
    FROM split WHERE str!=''
) SELECT word FROM split WHERE word!='';

sqlite 从表中获取数据

WITH split(word, str) AS (
    SELECT '', (select chi_sht from tr_map_org_basic where com_name_en='code cat' and status=1)||','
    UNION ALL SELECT
    substr(str, 0, instr(str, ',')),
    substr(str, instr(str, ',')+1)
    FROM split WHERE str!=''
) SELECT word FROM split WHERE word!='';

sqlite 从表中获取数据,union all 连接语句

WITH split(word, str) AS (
    SELECT '', (select chi_sht from tr_map_org_basic where com_name_en='code cat' and status=1)||','
    UNION ALL SELECT
    substr(str, 0, instr(str, ',')),
 
推荐文章
怕考试的木耳  ·  软件分享库合集链接汇总推荐_蓝奏云软件分享链接网站汇总手机 - 骑士助手
5 月前
精明的日记本  ·  江西省发布第三批非法集资严重失信人名单 _ 防范金融风险 _ 南昌县人民政府
1 年前
奔放的梨子  ·  Creating Word Application using Excel VBA: Run-time error '429': ActiveX component can't create obje
2 年前
奔跑的苦咖啡  ·  地藏菩萨本愿经讲记(第十三卷)
2 年前
愤怒的菠萝  ·  异兽魔都(林田球创作的系列漫画)_搜狗百科
2 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号