Stop Trying to Emulate SQL OFFSET Pagination with Your In-House DB Framework!

I'm pretty sure you've gotten it wrong in numerous ways, so far. And you probably won't get it right any time soon. So why waste your precious time on SQL tweaking, when you could be implementing business logic? Let me explain... It hasn't been until the recent SQL:2008 standard that what MySQL users know as … Continue reading Stop Trying to Emulate SQL OFFSET Pagination with Your In-House DB Framework!

Popular ORMs Don’t do SQL

I'm contemplating about what has happened in the ISO / IEC SQL standard during the last 15 years. We've had quite a few new features added to our beloved SQL language. Check this out: With the ISO/IEC SQL:1999 standard, we could take advantage of grouping sets and (recursive) common table expressions. With the ISO/IEC SQL:2003 standard, we’ve … Continue reading Popular ORMs Don’t do SQL

Binary data in SQL, more trivia

Yesterday, I blogged about inlining boolean literals in SQL. This goes on with other data types. Let's look at BLOBs and BINARY data in general. This is also defined in SQL standards, not in SQL 1992, though: <binary string literal> ::=   X <quote> [ <space>... ]   [ { <hexit> [ <space>... ] <hexit> … Continue reading Binary data in SQL, more trivia

SQL incompatibilities: NOT IN and NULL values

This is something where many hours of debugging have been spent in the lives of many SQL developers. The various situations where you can have NULL values in NOT IN predicates and anti-joins. Here's a typical situation: with data as ( select 1 as id from dual union all select 2 as id from dual … Continue reading SQL incompatibilities: NOT IN and NULL values