File: nested_cte.sql

package info (click to toggle)
libpg-query 17-6.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,416 kB
  • sloc: ansic: 175,684; sql: 79,564; ruby: 1,605; makefile: 276; cpp: 221
file content (11 lines) | stat: -rw-r--r-- 209 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
--- Note: This is a slightly odd choice (using a WITH on the INSERT's SELECT clause), but valid syntax
WITH q AS (
    SELECT 1 AS z
)
INSERT INTO t (a)
WITH qq AS (
    SELECT *
    FROM q
)
SELECT z
FROM qq