R CMD check --help
如何创建一个sql语句,该语句从 familyInfo Table
pFnumber
pInterviewee
pInterviewed
personInfo Table
pControlNo
pLname
pFname
表返回有关familyInfo
表和pLname
和pFname
的所有信息,条件为pFnumber = 1且pControlNo = 1
非常感谢帮助
答案 0 :(得分:0)
SELECT * FROM FAMILYINFO AS F
INNER JOIN PERSONINFO AS P ON F.PFNUMBER = P.PCONTROLNO
WHERE F.PFNUMBER = 1
在阅读评论后编辑为包含左外连接。我相信你说数据可能并不总是在familyinfo中,但你总是会有一个plname记录。
SELECT * FROM PERSONINFO AS P
LEFT OUTER JOIN FAMILYINFO AS F ON P.PCONTROLNO = F.PFNUMBER
AND F.PFNUMBER = 1