Modern SQL (@ModernSQL) header
Modern SQL (@ModernSQL) profile picture

Still using Windows 3.1? So why stick to SQL-92? A lot has changed in 30 years. We embrace the standard.

Vienna, Austria
Joined February 2015
Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)Photo by Modern SQL (@ModernSQL)
xxHash, a very fast, non-cryptography hash, gains popularity. Yesterdays MariaDB 13.1.2 GA brought has got some xxh functions: modern-sql.com/caniuse/xxHas…
2
15
1,254
The SQL/JSON Path item-method .keyvalue() has an interesting history in the Oracle Database. modern-sql.com/caniuse/keyva… In 23.26.2 it works, but not in ?( filter ) context.
2
3
909
ORDER BY Has Come a Long Way modern-sql.com/blog/2026-05/… The ORDER BY clause is one of the best-known SQL clauses. Yet there are a number of common misunderstandings that are worth clearing up. The article walks you through the evolution of the ORDER BY clause in the SQL standard.
1
7
1
26
2,280
Order-equivalent OVER clauses modern-sql.com/blog/2026-03/… About an important but rarely appreciated aspect when using multiple OVER clauses in a single query.
1
7
16
1,488
SQL Comments, Please! modern-sql.com/caniuse/comme… Standard SQL offers two flairs of comments: one starts by two dashes (--) and goes to the end of the line. The other starts with slash-asterisk (/*) and ends with asterisk-slash (*/). #SQL #DuckDB #PostgreSQL #MSSQL
1
1
4
841
Infinite Recursion Guards modern-sql.com/caniuse/with_… With recursive is the only SQL construct that is not guaranteed to terminate, eventually. As the DBMS is typically a very crucial system, infinite loops must be prevented at all times. See how various SQL systems help you.
2
9
812
WITHOUT OVERLAPS Constraints modern-sql.com/caniuse/witho… New in PostreSQL 18. Since 9.2, EXCLUDE constraints can be used for the same purpose.
1
4
570
GROUP BY ALL Very popular, not yet standard but set to become standard. Also expected for PostgreSQL 19. modern-sql.com/caniuse/group…
2
5
822
JSON support in SQL is not about storing JSON documents¹. While storing JSON in SQL tables is possible and sometimes quite useful, the true power of JSON in SQL comes from the ability to *process* JSON within SQL.
2
1
6
909
That means SQL can convert a JSON array from the client into a tabular form that can be processed very much like the result of a sub-query. Example: Passing an IN-list via a JSON array WHERE x IN (SELECT y FROM JSON_TABLE(?, '$[*]' COLUMNS (y INT PATH ‘$.y’)) AS jt)
2
3
95
Almost all of the timestamp related function-based indexes are unnecessary. Example: For this WHERE EXTRACT(YEAR FROM ts_col) = 2024 Someone might come up with that index: CREATE INDEX … ON … (EXTRACT(YEAR FROM ts_col)) While it works it is better to re-write the query...
1
1
8
748
WHERE ts_col >= DATE'2024-01-01' AND ts_col < DATE'2025-01-01' This just needs a regular index: CREATE INDEX … ON … (ts_col) Why is that a big deal? The index on the column itself is very versatile. It will also be good to find everything of yesterday...
1
4
81
There is no such thing as a division by NULL exception in SQL. Au contraire: Processing NULL values never causes an exception in SQL. That’s why you can use NULL to prevent exceptions cause by bad data: Just map bad values to NULL before the sensitive operation takes place.
1
3
8
867
Example: division by zero n / d becomes n / NULLIF(d, 0) If d = 0, NULLIF returns NULL instead of the value of d. NULL just propagates through the division. No exception, just a NULL (unknown) result. NULLIF is very well supported, btw. modern-sql.com/caniuse/nulli…
1
2
5
751
SQL's data types CHAR and VARCHAR are about characters. Sounds like a no-brainer, doesn't it? Well, a consequence is that the number in the parenthesis refer to characters, not bytes. Unfortunately, some SQL engines don't get that right—causing major confusion among users.
1
8
13
1,890
The evolution of character sets (single-byte ⇨ early Unicode/UCS-2 ⇨ Unicode 2.0+) was surely not helpful to get it right. The USC-2 mindset (2-bytes per character, only the Unicode Basic Multilingual Plane=BMP) is still present in recent versions of some SQL engines.
1
136
SQL's FILTER clause should be easy to implement for every engine. Why is it still not supported widely? Sure it can be emulated easily—and ugly. The value on readability (and learning) is huge. Please vendors: Just get it done. modern-sql.com/feature/filte…
1
8
1
32
4,933
All charts on modern-sql.com are updated for PostgreSQL 17. If you wonder what the new "BY SOURCE" option of MERGE does, here is my take: modern-sql.com/caniuse/merge…
5
1
33
2,922
Are You Qualified To Use Null in SQL? agentm.github.io/project-m36… Take this quiz to find out. Unfortunately, some of the questions go for implementation-defined behavior. Without knowing the engine, they cannot be answered correctly.
2
10
1,117
A typical source of confusion: ... NOT IN (NULL, …) is never true. modern-sql.com/concept/three…
3
7
1,338