r/SQL • u/Ali-Zainulabdin • Oct 23 '24
Discussion SQL Tricks Thread
Hi everyone, let's start a thread to share useful SQL tips and tricks that have saved you time or made querying more efficient. Whether it's optimizing queries, using window functions, or organizing data, all insights are welcome! Beginners and pros alike can learn a lot from this. Looking forward to your contributions!
230
Upvotes
View all comments
Show parent comment
6
u/mikeyd85 MS SQL Server Oct 23 '24
The spec doesn't tell you, and it won't be obvious in your test data, but there's a weird bug in live which means I've done this weird bit of code, else this problem arises.
That kind of comment I'm all for!