Supporting the WITH clause

The following list shows which engines support the WITH clause and which don't:

  • MariaDB: Not supported
  • MySQL: Not supported
  • PostgreSQL: Supported since PostgreSQL 8.4
  • SQLite: Supported since 3.8.3
  • Db2 LUW: Supported since 8 (year 2000)
  • Oracle: Supported since 9iR2
  • Microsoft SQL Server: Supported since 2005
Note that in PostgreSQL, a CTE can even support writes (INSERT, UPDATE, and DELETE clauses). There is no other database I am aware of that can actually do that.

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.