我正在尝试以某种父/子方式对查询结果进行排序。我想知道是否有一种简单的方法可以做到这一点。
目的:
Video : [id, parent_id, date] // where parent_id can be null - meaning it is a 'root' node.
我想要的查询集排序:
Video 1: [123, null, 01/11]
Video 2: [111, 123, 02/11]
Video 3: [144, 123, 04/11]
Video 4: [191, null, 03/11]
Video 5: [118, 191, 03/11]
Video 6: [121, 191, 05/11]
Video 7: [411, null, 04/11]
...
有没有办法在查询集中实现这种父/子组排序?