There are many different datetime related functions such as DAY, MONTH, YEAR, DATEDIFF, etc available in SQL Server. For example, YEAR function can be used to extract year value from a date.
What is Alternative to CASE Statement in SQL Server? – IIF Function – Interview Question of the Week #164
Question: What is Alternative to CASE Statement in SQL Server?
SQL SERVER – Puzzle – Get the First Name From Full Name Without CHARINDEX
Recently I have been engaged with a customer where they were having a performance issue. They have engaged me via my offering Comprehensive Database Performance Health Check. While doing that, they asked me to write a better way to write a query. While I have given some suggestions and asked them to check, this looks like a nice puzzle to ask. So here we go to see the puzzle – Get the First Name From Full Name Without CHARINDEX.
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.
How to Find DISTINCT COUNT of Column Rows Without Using Distinct Count Keywords? – Interview Question of the Week #157
Question: How to Find DISTINCT COUNT of Column Without Using Distinct Count Keywords?
SQL SERVER – Performance Observation of TRIM Function
Earlier I wrote a blog post about how to remove leading and trailing spaces with TRIM function. SQL SERVER – 2017 – How to Remove Leading and Trailing Spaces with TRIM Function? After writing this blog post lots of people asked me its impact on SQL Server.Â
How to Get Top N Records Per Group? – Ranking Function – Interview Question of the Week #156
Question: How to Get Top N Records Per Group? (using Ranking Function)Â
Answer:Â During a recent interview, I had given this simple puzzle to over 40 candidates. This simple puzzle depends on Ranking Window Functions.