On May 21, 2014, at 6:00 PM, Humblebee <[email protected]> wrote:
> At least this is what I'm thinking from my very very limited understanding of
> SQL and with the way that I'm trying to do this.
SMITH: Doctor, it hurts when I do _this_.
DALE: Don’t _do_ that.
with
DataSet
as
(
select 'a,b,c,' as string
),
CSV( string, value, position )
as
(
select substr( string, instr( string, ',' ) + 1 ) as string,
substr( string, 1, instr( string, ',' ) - 1 ) as value,
1 as position
from DataSet
union all
select substr( string, instr( string, ',' ) + 1 ) as string,
substr( string, 1, instr( string, ',' ) - 1 ) as value,
position + 1 as position
from CSV
where length( string ) > 0
)
select value,
position
from CSV;
> value|position
> a|1
> b|2
> c|3
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users