Lextree Simply the best software for managing legal entities and documents.
The Berkman Letter Practical analysis and commentary for business, law, and more.

Need help about auto incrementing issue in SQL in Oracle

0
stars
0
answers
9
views
I have a table like this: https://www.linkpicture.com/view.php?img=LPic6233322955e35422476399

I want to automatically increment values in ID column where the difference between the previous value and other value is greater than 1.

So, I want like this: https://www.linkpicture.com/view.php?img=LPic623332bee51691149467893
I tried lag() to compute the differences in ID column then tried to make an update loop but it didn't work. I'm also a beginner in SQL, so I would be grateful for any help.