So I have the following recursive
WITH RECURSIVE length(len, id, ord) AS (
SELECT 0, t.id, 1
FROM temp t
UNION
SELECT len + compute(
SELECT w2.nodeid
FROM waypoint w2
WHERE w2.ordinal = ord AND w2.wayid =t.id,
SELECT w2.nodeid
FROM waypoint w2
WHERE w2.ordinal = ord + 1 AND w2.wayid =t.id
), t.id, w1.ordinal
FROM waypoint w1, length, temp t
WHERE w1.wayid = t.id AND w1.ordinal = ord + 1
),
SELECT *
FROM length
The issue is that I keep getting this error
sqlite3.OperationalError: near "SELECT": syntax error
compute is just a user defined sqlite function that takes two node ids to compute the distance between them.
JOIN
syntax in the ANSI-92 SQL Standard (almost 30 years ago) and its use is discouraged