Feature #17461
closed
Added by Jan Haller 7 months ago.
Updated 6 months ago.
Description
The WITH keyword signifies a Common Table Expression (CTE). It allows you to refer to a subquery expression many times in a query, as if having a temporary table that only exists for the duration of a query. More
It has yet to be included in QFQ.
Files
E.g.:
WITH RECURSIVE CountNumbers AS (
SELECT 1 AS Number
UNION ALL
SELECT Number + 1
FROM CountNumbers
WHERE Number < 4
)
SELECT Number FROM CountNumbers;
Result:
WITH enables the possibility to fire subqueries as often as wanted without the need of actual records being selected.
E.g.:
10.sql = SELECT 10 AS _myCount
20 {
sql = WITH RECURSIVE CountNumbers AS (
SELECT 1 AS Number
UNION ALL
SELECT Number + 1
FROM CountNumbers
WHERE Number < '{{myCount:R0}}'
)
SELECT Number FROM CountNumbers
30 {
sql = SELECT '<br>'
}
}
- Tracker changed from Support to Feature
- Target version changed from 24.10.0 to 24.1.0.rc1
- Status changed from New to Closed
Also available in: Atom
PDF