Please explain the name magickway..
我本來的想法:
select A.name<個(gè)人信息..>, B.name, C.name from A,
(select A.id, A.name from A where A.id in
(select A.father_id from A where A.id=@id)) B,
(select A.id, A.name from A, wife where wife.id=A.wife_id) C
where A.id=@id
結(jié)果:得到個(gè)人姓名,父親姓名,母親姓名
注:A-個(gè)人信息表,wife-妻子表,@id-已知該人員id參數(shù)
問題來了,如果多個(gè)妻子和兄弟姐妹,那就很難寫了,我之前遇到這情況,現(xiàn)在寫不出來。