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

asp.net - Change the driver in the connection string to a data source in VB.Net -

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -