Why isn't SQL ANSI-92 standard better adopted over ANSI-89?

后端 未结 16 1937
日久生厌
日久生厌 2020-11-22 10:59

At every company I have worked at, I have found that people are still writing their SQL queries in the ANSI-89 standard:

select a.id, b.id, b.address_1
from          


        
16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 11:25

    A few reasons come to mind:

    • people do it out of habit
    • people are lazy and prefer the "old style" joins because they involve less typing
    • beginners often have their problems wrapping their heads around the SQL-92 join syntax
    • people don't switch to new syntax just because it is there
    • people are unaware of the benefits the new (if you want to call it that) syntax has, primarily that it enables you to filter a table before you do an outer join, and not after it when all you have is the WHERE clause.

    For my part, I do all my joins in the SQL-92 syntax, and I convert code where I can. It's the cleaner, more readable and powerful way to do it. But it's hard to convince someone to use the new style, when they think it hurts them in terms of more typing work while not changing the query result.

提交回复
热议问题