mysqlだけwith句非対応とか
元々mysqlばっかで、最近よくOracle触ってるのですが。
Oracleでwith句の存在知って、SQLで再帰表現使えて便利だな〜、って思っていたら、
むしろwith句が使えるのが当り前っぽい。
というか、SQLiteですら使えるのね。
MySQL does not support queries using theWITH
syntax defined in SQL-99, also called Common Table Expressions.This has been a feature request for MySQL since January 2006: http://bugs.mysql.com/bug.php?id=16244
Other RDBMS products that support common table expressions:
- Oracle 9i release 2 and later:
http://www.oracle-base.com/articles/misc/with-clause.php- Microsoft SQL Server 2005 and later:
http://msdn.microsoft.com/en-us/library/ms190766(v=sql.90).aspx- IBM DB2 UDB 8 and later:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000879.htm- PostgreSQL 8.4 and later:
http://www.postgresql.org/docs/8.4/static/queries-with.html- Sybase 11 and later:
http://dcx.sybase.com/1100/en/dbusage_en11/commontblexpr-s-5414852.html- SQLite 3.8.3 and later:
http://sqlite.org/lang_with.html- HSQLDB:
http://hsqldb.org/doc/guide/dataaccess-chapt.html#dac_with_clause- Firebird 2.1 and later (the first Open Source DBMS to support recursive queries):http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes210.html#rnfb210-cte
- H2 Database (but only recursive):
http://www.h2database.com/html/advanced.html#recursive_queries