Home t-sql: dense rank that is increased at every occurence of a flag
Reply: 0

t-sql: dense rank that is increased at every occurence of a flag

user426
1#
user426 Published in April 27, 2018, 6:51 am

I have a table that has Parent Rows and Children Rows. The table consists of an increasing sequence, a row indicating whether it is a child or a parent and a code. I need to create ranking (an increasing number) that is increased only at every occurrence of IsParent column (values:0,1).

This is the table that I have: original table

This is the desirable result table: result table

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.325471 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO