The other day during one of my old clients sent me an email about if I know any trick to get the second row from the resultset.
How to Skip Top N Rows in SQL Server? – Interview Question of the Week #237
Question: How to skip top N Rows in SQL Server and retrieve the rest of the rows? Answer: I had asked the above question in one of the interviews last week.
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 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.
How to Find Median in SQL Server? – Interview Question of the Week #116
Question: How to Find Median in SQL Server?
MySQL – Reset Row Number for Each Group – Partition By Row Number
MySQL – Generating Row Number for Each Row Using Variable
MySQL does not have any system function like SQL Server’s row_number () to generate the row number for each row. However, it can be generated using the variable in the SELECT statement. Let us see how MySQL Generating Row Number.