-3
表1和表2MY SQL,從同一個表中的父子關係從其他表獲得子值獲取列名
在表1中:
Question ID Question Name
1 a
2 b
3 c
4 d
5 e
6 f
7 g
在表2中,家長的問題ID與孩子的問題ID的關係,其從表1來源:
parent Question ID child Question ID
1 2
1 5
1 4
1 3
6 7
現在我需要的答案,得到結果如下:
Question ID Question Name
1 a
2 b
5 e
4 d
3 c
6 f
7 g
請提供它的mysql查詢。在此先感謝
您可能需要執行兩個查詢,並將結果合併到應用程序端。您使用什麼語言來消化查詢的結果? –
「Table2」中是否有一列保證可以按照您顯示的順序查詢它? –
hello joe Iam使用coldfusion .. – anter05