Skip to content
Advertisement

SQL History Traversal Table

Let’s say I have a table t

With a number of 5, how do I traverse back in history 2 times to derive the result to be black or white?

Assuming there are other rows of data in the table as well.

I have tried:

Advertisement

Answer

If the requirement is upto 2 level, you can try this below logic-

DEMO HERE

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement