First of all answer this question : Which method of T-SQL is better for performance LEFT JOIN or NOT IN when writing a query? The answer is: It depends! It all depends on what kind of data is and what kind query it is etc. In that case just for fun guess one option LEFT JOIN or NOT IN. If you need to refer the query which demonstrates the mentioned clauses, review following two queries for Join Better Performance.
SQL SERVER – Simple Puzzle Using Union and Union All – Answer
Yesterday I posted a puzzle SQL SERVER – Simple Puzzle Using Union and Union All, today we will see the answer of this. Following image explains the answer of puzzle. You can read the explanation of why this is answer read my previous article SQL SERVER – Union vs. Union…
Read MoreSQL SERVER – 2005 – Find Nth Highest Record from Database Table – Using Ranking Function ROW_NUMBER
I have previously written SQL SERVER – 2005 – Find Nth Highest Record from Database Table where I have shown query to find 4th highest record from database table. Everytime when I write blog I am always very eager to read comments of readers. Some of regular readers are industry…
Read MoreSQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL – Part 3
Please read SQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL before continuing this article. I had asked users to come up with alternate solution of the same problem. Khadar Khan came up with good solution using CTE SQL SERVER – How to Retrieve TOP and…
Read MoreSQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL – Part 2 – CTE
Please read SQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL before continuing this article. I had asked users to come up with an alternate solution of the same problem. In this blog post we will see solution with the help of CTE.Â
SQL SERVER – Quick Note on CROSS APPLY
Yesterday I wrote article about SQL SERVER – 2005 – Last Ran Query – Recently Ran Query. I had used CROSS APPLY in the query. I got email from one reader asking what is CROSS APPLY. In simpler words, cross apply is like inner join to table valued function which can take parameters. This particular operation is not possible to do using regular JOIN syntax You can see example of CROSS APPLY in my article here.