Open tastott opened 8 years ago
These could be implemented as parameterized queries which may refer to themselves in sub-queries.
-- Declare the parameterized query
WITH
(
SELECT
Blah AS Thing,
(SELECT * FROM MyQuery(Children)) AS ThingChildren -- Recursive sub-query over Children array property
FROM
@@Table -- Special identifier for table parameter
) AS MyQuery
-- Use it with anything which would normally go in a FROM clause
SELECT * FROM MyQuery('file://test.json')
This would be useful for transforming tree structures.