Using Case when with insert statement
Hello All,
I want to create a query in sql for the below table
Cost Center Position ID
|
I want to input the ID of particular row on the basis of cost center of the previous row. For row 1, The value of ID should be 1
For row 2, The value should be 1+1 =2 as the cost center of previous row is same as the current row. The value of ID for row 3, should be 1 as the cost center of previous row is not same as the cost center of current row.
Thanks in advance