Tag Archives: ROW_NUMBER()

t-SQL to find top X toppers in each subject from marks table

rank() function in SQL can be used to find such results in SQL! Here is the simple example for FUN 🙂 Reference/ New features in SQL 2012: https://vijredblog.wordpress.com/2014/02/18/tsql2012-less-frequently-used-features-revision-01/

Posted in Script, SQL, SQL Query | Tagged , , , | Leave a comment

Identify and delete duplicate records in a table – SQL

One of the best option is to use CTE, ROW_NUMBER() to identify and delete duplicate records Sample Code/Demo: Note: If one of the column is of type NText, will not be able to sort based on the column and it … Continue reading

Posted in Productivity, Script, SQL, SQL Query | Tagged , , , , , | 2 Comments