Hi,
I’ve got a table, where I need to sort IDs in a way, that the previous ID is referenced by the next row’s 'Prev_ID' field. (It’d also be possible to use Follow_ID instead of Prev_ID accordingly, if that’s easier)
table:
the sort order I want to achieve is: 1 - 10 - 2 - 17 - 3 - 33 - …, but I have no idea, how to do that (cursors?). could anyone point me into the right direction?
Thanks, Dormi
I’ve got a table, where I need to sort IDs in a way, that the previous ID is referenced by the next row’s 'Prev_ID' field. (It’d also be possible to use Follow_ID instead of Prev_ID accordingly, if that’s easier)
table:
Code:
ID | Prev_ID ––––+––––––––– 1 | NULL 2 | 10 3 | 17 … 10 | 1 … 17 | 2 … 33 | 3
Thanks, Dormi