数据库
首页 > 数据库> > sqllite中实现字符串分割

sqllite中实现字符串分割

作者:互联网

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

标签:分割,word,instr,substr,split,str,字符串,SELECT,sqllite
来源: https://www.cnblogs.com/linyuansun/p/10783289.html