Hi All,
I have to query a data that look something like this:
col_a col_b col_c
1 10 200
2 10 201
3 10 202
4 10 205
1 20 100
2 20 101
Now col_c should always increament by one. In row 5 the the value jumped to 205. There for its an error and I want to output that error with col_a and col_b to the user.
Once the col_b changed to 20 I have to check the col_c again to see if the values are incrementing by one again. In this case col_b is 20 and its fine(100, 101). I also have to also should do an order by on the col_a. Then I have to check the col_c. Do I need to write a procedure or can I do this in a script? The table in concern is pretty big.
My query should return:
col_a col_b col_c
4 10 205
Any thoughts will be greatly appreciated.
I have to query a data that look something like this:
col_a col_b col_c
1 10 200
2 10 201
3 10 202
4 10 205
1 20 100
2 20 101
Now col_c should always increament by one. In row 5 the the value jumped to 205. There for its an error and I want to output that error with col_a and col_b to the user.
Once the col_b changed to 20 I have to check the col_c again to see if the values are incrementing by one again. In this case col_b is 20 and its fine(100, 101). I also have to also should do an order by on the col_a. Then I have to check the col_c. Do I need to write a procedure or can I do this in a script? The table in concern is pretty big.
My query should return:
col_a col_b col_c
4 10 205
Any thoughts will be greatly appreciated.