好的,这是选择语句
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 最新结果的字段