Search code examples
rdbmsansi-sql

Where can I get the ANSI or ISO standards for the RDBMS queries?


I want to write some queries which can work in almost all the databases without any SQLExceptions. So, where can I get the ANSI standards to write the queries ?


Solution

  • Not sure that'll help you.

    Vendors are touch and go as far as standards implementation and often the standards themselves are imprecise enough such that you could never write a query that would work with all implementors.

    For example, SQL 92 defines the concatenation operator as || but neither MySQL nor MSSQL use this (Oracle does). Vendor independent string concatenation is impossible.

    Similarly, a standard escape character is not specified so how you handled that might not work in all vendors.

    Having said that: