sql server 2005 - How to add Row_number to table function results -


I have a function that gives a group (cluster) from a table.

  Create function dbo.ftAllClusters () Select the different cluster from the company as the return table in the form of the return  

Now I need to add the line number for each line .. < / P>

  select cluster, ROW_NUMBER () over (order of cluster) AS RowNo FROM (related to company Select cluster) x  

...

  select cluster, ROW_NUMBER () over (order of cluster) AS RowNo FROM COMPANY GROUP by cluster  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -