Query for updating a node in hierarchial tree structure

The two parameters represent the ordinal position of the node.

The first parameter indicates the node that precedes it and the second parameter represents the node that will follow it.

Let’s go ahead and create some additional offices and populate them with sales data.

Results: Now that we have populated the table we want to be able to easily query and display the hierarchy.

It’s fairly common to want to store hierarchical data in a database table.