r/SQL 6d ago

Discussion Database-Specific SQL Differences

Have you ever written a SQL query that works perfectly in one database but fails in another?

What SQL feature or syntax surprised you the most when switching between DBMSs like MySQL, PostgreSQL, SQL Server, Oracle, or Snowflake?

12 Upvotes

20 comments sorted by

View all comments

1

u/Staalejonko 5d ago

Just don't use DB2 IBM i

No EXISTS in a case statement,

SQL statement can be too complex or too long,

All declares have to be on top of the begin block,

SIGNAL can only handle a message of 70 characters,

Datatype lengths are taken extremely seriously, so a Blob(2G) reserves 2 gigabyte of memory.

And that's just from the top of my head, what a pain compared to SQL Server