Order parent child records by parent group and children
问题 I need sort query results by specific two related columns. My table is: Row no | Col 1 | Col 2 | Col 3 | Col 4 1 | 1 | X | 1 | 5 2 | 2 | Y | 1 | 6 3 | 5 | Z | 2 | 7 4 | 6 | T | 2 | 0 5 | 7 | T | 3 | 0 6 | 6 | W | 2 | 0 The values in Col 4 represents the child record linked to Col 1 . So for Row no = 1 the next child record is row 3, where Col 1 holds the value of Col 4 from the first row. The next child row for row 3 is row 5, based on the link between Col 1 and Col 4 . And I'd like to return