sqlansi-92

Are the following select statements SQL92 compliant?


Are the following select statements SQL92 compliant?

SELECT table1.id, table2.id,*  
FROM table1, table2  
WHERE table1.id = table2.id  

SELECT table1.Num, table2.id,*  
FROM table1, table2  
WHERE table1.Num = table2.id  

Solution

  • Yes, the queries you show use SQL92 compliant syntax. My copy of "Understanding the New SQL: A Complete Guide" by Jim Melton & Alan R. Simon confirms it.

    SQL92 still supports joins using the comma syntax, for backward compatibility with SQL89. As far as I know, all SQL implementations support both comma syntax and JOIN syntax joins.

    In most cases, the SQL implementation knows how to optimize them so that they are identical in semantics (that is, they produce the same result) and performance.