…is every single damn blog post out there that says “You should never use” !

I read another one of these such blog posts today, and like always, it really got my goat. Every few months, there’s another piece of nonsense out there

  • “You should never use OUTER JOIN”
  • “You should never use DISTINCT”
  • “You should never use NOT EXISTS”
  • etc etc etc

Sometimes this tosh is hidden in the alternative guise of always picking some thing over another.

  • “Always use NOT IN instead of NOT EXISTS”
  • “Always use COALESCE not NVL”

If any particular SQL clause, phrase, strategy could be categorised into an absolute of “Never” then you would think that in the 50 years that SQL has been around then it would have been be slowly phased out by now. Even if it had not been removed from the language, it would disappear from view in code bases due to lack of use. But last time I checked, pretty much every element of the SQL language has a reasonable chunk of use out of there in the interwebs.  (OK, maybe the MODEL clause is one exception to that, but even that I’m sure has a use case somewhere that justifies its existence)

Just please, for the sake of all of us in the IT profession, use SQL with an open mind and use any or all of it when the time is appropriate.

Addenda: This also goes for recruiters and interviewers as well. What on earth are you thinking when you come with questions like

“Write a query that shows the total sales without using MAX, MIN, SUM or GROUP BY?

That is the just dumbest BS ever.

3 responses to “The One SQL Thing You Should Never Use”

  1. Thank you for the reiteration. I hope many read and acknowledge this fact. 

    There is another ‘myth’ that people believe in. i.e., Views are bad and materialized views are unfriendly. I tell them, it always a bad query behind the view to be blamed and not the usage of it.

  2. I’ve got to say that NATURAL JOIN is an abomination that should never have been included in the SQL standard. Only very possibly should you consider it if you are joining the results of two subqueries where you are explicitly listing the columns returned by each. Maybe.

  3. ronaldbradford Avatar
    ronaldbradford

    I guess to a recruiter that asked such a BS question.Can you please repeat the question, only this time you are not allowed to speak, just use hand-signals? See how that feels.

Leave a reply to Gary Myers Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trending