SQL: get rank of a data set after sorting data?

If you're using SQL Server 2005 and newer, you can use the RANK() or DENSE_RANK() windowing functions.

If you're using SQL Server 2005 and newer, you can use the RANK() or DENSE_RANK() windowing functions: SELECT (your list of columns here), RANK() OVER(ORDER BY yourcolumnnamehere) FROM dbo. YourTable or: SELECT (your list of columns here), DENSE_RANK() OVER(ORDER BY yourcolumnnamehere) FROM dbo. YourTable See explanation of difference between RANK and DENSE_RANK here Other RDBMS (like Oracle) also seem to support those windowing functions.

1 You can add PostgreSQL 8.4+ to the list, window functions are awesome. – mu is too short 2 days ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions