If you are a SQL Developer, Business Analyst, or DBA you may find this article by Zakary LeBlanc useful. Here’s a brief excerpt – check it out!
Seeing a DISTINCT clause in the final output of a SQL script is a screaming warning. It betrays a lack of understanding of how the data works. What’s worse is that, in many cases, it betrays a lack of effort or desire to figure out how the database structures work together. But you must understand your data if you expect to extract information and provide insights that impact your company in meaningful ways.
So let’s take a look at an pretend example of a problematic query. Often the worst performing queries look a little like this:
When I see something like this I immediately know that there must be duplication in the results and the DISTINCT clause is being used to remove them…
Using DISTINCT in SQL Queries is a Warning Sign by Zakary LeBlanc on Medium.com
Continue reading the article on Medium using the link below.
Leave a comment