SQLITE Query results into a temp table SQLITE Query results into a temp table sqlite sqlite

SQLITE Query results into a temp table


The CREATE TABLE statement does not allow CTEs, but the SELECT does:

CREATE TEMPORARY TABLE ParentChild ASWITH FT_CTE AS (    SELECT pID, cID FROM brFTNode_Children     WHERE pID = 1    UNION ALL    SELECT e.pID, e.cID FROM brFTNode_Children e    INNER JOIN FT_CTE ftCTE ON (ftCTE.cID = e.pID))SELECT * FROM FT_CTE;