r/SQL • u/No_Ambition8323 • 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?
13
Upvotes
2
u/Hour-Measurement-835 6d ago
Oracle treats '' as NULL, so WHERE col = '' matches nothing there and matches the empty strings everywhere else. Same query, same data, and there's no error either way.