sql-standards

Plain SQL vs Dialects

DBMS Vendors use SQL dialect features to differentiate their product, at the same time claiming to support SQL standards. 'Nuff said on this. Is there any example of SQL you have coded that can't be translated to SQL:2008 standard SQL ? To be specific, I'm talking about DML (a query statement), NOT DDL, stored procedure syntax or anyth...

Why do I need to explicitly specify all columns in a SQL "GROUP BY" clause - why not "GROUP BY *"?

This has always bothered me - why does the GROUP BY clause in a SQL statement require that I include all non-aggregate columns? These columns should be included by default - a kind of "GROUP BY *" - since I can't even run the query unless they're all included. Every column has to either be an aggregate or be specified in the "GROUP BY", ...

How to test sql scripts are standard sql in junit tests?

Is there any way to test that SQL scripts contain standard SQL with java/junit tests? Currently we have sql scripts for creating a database etc. in a Postgres db, but when using hsqldb everything fails. That's why I wonder if any java tools exist for testing if sql statements are standard sql. Or would it just be wise to create differe...

Is TRUNCATE a DML statement?

Can we classify/say that TRUNCATE belongs to/falls under DML statement? Check here for PostgreSQL TRUNCATE compatibility. NOTE: TRUNCATE is part of SQL standard ANSI SQL 2008 - F200 ...