Option 2: with clause

BigQueryDb2 (LUW)MariaDBMySQLOracle DBPostgreSQLSQL ServerSQLite2009201120132015201720192021✓ 3.8.3 - 3.43.0⊘ 3.5.7 - 3.7.11✓ 2008R2 - 2022b✓ 8.4 - 16⊘ 8.3✓ 11gR2 - 21c⊘ 11gR1a✓ 8.0.11 - 8.0.34⊘ 5.0 - 5.7✓ 10.2 - 10.11⊘ 5.1 - 10.1✓ 9.7 - 11.5.8⊘ 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