I have made note that ORDER BY is not required when DISTINCT is used. Let us understand the same subject in detail. Let us learn today.
SQL SERVER – How to Order By a Parameter?
We figured out that there was a very poor code written in one of the Stored Procedure’s Order By clause. Let us learn today how to order by a parameter.
SQL SERVER – Group By Orders Data by Columns Ascending
The question was about Group By Orders Data by Columns Ascending. DBA asked me an interesting question referring to my older blog.
How to Sort a Varchar Column Storing Integers with Order By? – Interview Question of the Week #206
Question: How to Sort a Varchar Column Storing Integers with Order By?
SQL Server – Formatted Date and Alias Name in ORDER BY Clause
CONVERT function can be used to change the format of DATE to various formats like MM/dd/yyy, dd/MM/yyy, yyy/MM/dd, etc. But have you ever noticed that this will produce resultset with a different order if the alias name is used in ORDER BY Clause? Well, I just learned about the formatted date from my recent consulting engagement Comprehensive Database Performance Health Check.
SQL SERVER – Adding Values WITH OVER and PARTITION BY
Once in a while, I get questions where users have indeed explained the question well enough that I can easily understand their question. If I understand question quickly, I am always able to answer it efficiently as well. In this blog post, we will see one such question which I answered with keywords WITH OVER and PARTITION BY.
How Does TOP WITH TIES Work in SQL Server? – Interview Question of the Week #159
Question: How Does TOP WITH TIES Work in SQL Server?
Answer: This is an ancient question I just encountered in the recent Comprehensive Database Performance Health Check.