好太多結果,這裏的select語句左外Select查詢連接返回從主表
SELECT dbo.tbl_inspectors.user_firstname,
dbo.tbl_inspectors.user_lastname,
dbo.tbl_inspectors.user_loc,
dbo.tbl_appraisals.appPartA,
dbo.tbl_appraisals.appPartB,
dbo.tbl_appraisals.appAppraised,
dbo.tbl_appraisals.appFinalized,
dbo.tbl_appraisals.appDate,
dbo.tbl_inspectors.appProcStart,
dbo.tbl_inspectors.appDue,
dbo.tbl_inspectors.inspAdhocStaff,
dbo.tbl_inspectors.access_id,
dbo.tbl_appraisals.appraiseID, dbo.tbl_inspectors.user_id
FROM dbo.tbl_inspectors
LEFT OUTER JOIN
dbo.tbl_appraisals ON dbo.tbl_inspectors.user_id = bo.tbl_appraisals.inspectID
如果有反對的tbl_appraisals表tbl_inspectors.user_id多個結果,然後我得到了多個結果每個檢查員,我只是想要它從tbl_appraisals對tbl_inspectors user_id拉最近的比賽,我怎麼能做到這一點?
PS tbl_appraisals.appDate是確定從tbl_appraisals
確定最近一行的列是什麼? – 2013-02-21 09:52:26
tbl_appraisals.appDate – 2013-02-21 10:05:49