【发布时间】:2013-04-18 00:20:02
【问题描述】:
我已经简化了一点来问这个问题。因此,请随心所欲地使用表格。
我有两张桌子
父表列是
ParentId,Parent_FirstName,Parent_LastName
子表列是
ChildId,Child_FirstName,Child_LastName,ParentId,Parent_FirstName,Parent_LastName
父表有一条记录
1,Joe,Bloggs
子表有3条记录
1,Bob,Lawrence,1,,
2,Sam,Hunt,NULL,Joe,Bloggs
3,Sam,Hunt,1,,
我希望能够通过使用查询获得以下信息
Joe Bloggs Bob Lawrence
Joe Bloggs Sam Hunt
但是..我希望能够通过以下链接父子表
1)If there is a parentid on the child table then link using the parentid
2)Else compare the parent_first and parent_lastname in the child table with that of the child tables
提前致谢
【问题讨论】: