Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sqlite select split string

-- using your data table assuming that b3 is suppose to be b2

WITH split(one, many, str) AS (
    SELECT one, '', many||',' FROM data
    UNION ALL SELECT one,
    substr(str, 0, instr(str, ',')),
    substr(str, instr(str, ',')+1)
    FROM split WHERE str !=''
) SELECT one, many FROM split WHERE many!='' ORDER BY one;

a|a1
a|a2
a|a3
b|b1
b|b2
c|c2
c|c1
Comment

PREVIOUS NEXT
Code Example
Sql :: android sqlite database example 
Sql :: postgresql concat string with separator 
Sql :: oracle generate list of dates in between a date range 
Sql :: read xml in sql server 
Sql :: access no password in mysql mamp 
Sql :: run docker container with database as rds metabase 
Sql :: generate random & unique mysql string 
Sql :: soql user profile 
Sql :: insert query mysql workbench 
Sql :: create a PostgreSQL user django on mac 
Sql :: delete from table sql 
Sql :: sql script to remove default from column 
Sql :: influxdb delete measurement based on date 
Sql :: how to force truncate a table in mysql 
Sql :: connect to mysql c# connection string C# 
Sql :: porcentaje sql 
Sql :: mysql join two tables 
Sql :: how to get max salary in each department in sql 
Sql :: change schema of all tables postgres 
Sql :: sql like case sensitive 
Sql :: add column postgresql 
Sql :: SQL Server OPENQUERY WITH result SETS 
Sql :: docker hub mysql 
Sql :: how to generate ids in sql 
Sql :: wamp server mysql password 
Sql :: sql change column name based on value 
Sql :: where clause for clob in oracle 
Sql :: select count concat string sql server 
Sql :: update field in sql to null 
Sql :: in in sql 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =