Option 2: with clause

BigQueryDb2 (LUW)MariaDBMySQLOracle DBPostgreSQLSQL ServerSQLite20072009201120132015201720192021✓ 3.8.3+⊘ 3.5.7 - 3.7.11✓ 2008R2+b✓ 8.4+⊘ 8.3✓ 11gR2+⊘ 11gR1a✓ 8.0.11+⊘ 5.0 - 5.7✓ 10.2+⊘ 5.1 - 10.1✓ 9.7+⊘ 2.0
  1. with is supported since 9iR2, but column aliases only since 11gR2 (ORA-32033)
  2. Only allowed at the very begin of a statement. E.g. with...insert...select