Editorials

It Isn’t ANSI Standard

Lately I’ve been reading a lot of blogs and online content about many different SQL topics, reaching back into how we used to do things in the old days. One phrase I see consistently is that a certain syntax, “does not follow the ANSI standard.” Sometimes they writer is incorrect.

One thing that is true about the SQL syntax is that it is a dynamic, slowly moving specification, being modified to enhance capabilities, and standardize ways that things are done. An engine that is ANSI Compliant for the SQL Syntax is more likely to be used because the code is more transportable to other data engines.

So, lest we forget, the ANSI SQL specification is always maturing. Since SQL was picked up to be a managed specification there have been a number of versions with specific features added in each time. WikiPedia has a nice list of the different major releases. Not all vendors meet all of the specifications for any release. Moreover, they are sometimes ahead of the specification, releasing features still being defined in the specification.

The point is that, if there are differences in syntax for SQL to do the same thing, it doesn’t mean that either one of the different implementations must not be ANSI compliant. They may not be compliant. But, since the standards have changed over time, it is possible to have two different queries using different syntax both follow different ANSI standards.

Aim to use the later specification in your code. But, don’t assume that someone doing something else was using a bazzar implementation from some rogue database engine.

Cheers,

Ben

Facebooktwittergoogle_plusredditpinterestlinkedinmail