SQLite Forum

Recursive CTE
Login
How about this? (assuming a rowid table)

with recursive pointNums (orig_rowid, n, max_n) as (
    select rowid, 1, NumPoints(exteriorring(shape)) from tmp
    union all
    select orig_rowid, n + 1, max_n
    from tmp
    where n < max_n
)
select
tmp.rowid,
tmp.Place,
n,
X(PointN(exteriorring(shape), n)) as Longitude,
Y(PointN(exteriorring(shape), n)) as Latitude
from
tmp inner join pointNums
on pointNums.orig_rowid = tmp.rowid
order by rowid, n;