Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SQL Query recursive

$
0
0

I have data as below  in table1 the data value is in sequence for conditionID for every measure id.  However I want to write a query (view/table also) to get he min and max of every measure id and generate sequence as a separate column 

MeasureId   CondID   ...

1                81

1                82

1                83

2               1001

2               1002

 What I want is 

1               81        1

1              82         2

1              83         3

2              1001     1

2              1002     2

..

..


Neil


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>