here is my example:CREATE TABLE test (XOrder INT, Child INT, Parent INT)goINSERT INTO test VALUES (1, 100, NULL)INSERT INTO test VALUES (1, 107, 106)INSERT INTO test VALUES (1, 106, NULL)INSERT INTO test VALUES (1, 101, 100)INSERT INTO test VALUES (1, 102, 100)INSERT INTO test VALUES (1, 104, 102)INSERT INTO test VALUES (1, 103, 100)INSERT INTO test VALUES (1, 105, 102)goDROP TABLE testgo-- Test without ORDER BYSELECT * FROM testgoXOrder Child Parent----------- ----------- -----------1 100 NULL1 107 1061 106 NULL1 101 1001 102 1001 104 1021 103 1001 105 102-- Test with ORDER BYSELECT * FROM test ORDER BY child, parentgoXOrder Child Parent----------- ----------- -----------1 100 NULL1 101 1001 102 1001 103 1001 104 1021 105 1021 106 NULL1 107 106
So, XOrder is completely unneccesary with SQL-ec