SELECT TOP (100) PERCENT dbo.vwLatestEquipment.equipServID, dbo.tblEquipInvoice.invoiceDateSent, dbo.tblEquipment.equipManafacturer,
dbo.tblEquipInvoice.contractNumber, dbo.tblEquipment.equipmentID, dbo.tblEquipment.equipStatus, dbo.tbl_work_locations.work_location,
dbo.vwLatestEquipment.calibDueDate
FROM dbo.vwLatestEquipment INNER JOIN
dbo.tblEquipLocations ON dbo.vwLatestEquipment.locationID = dbo.tblEquipLocations.locationID INNER JOIN
dbo.tblEquipInvoice ON dbo.tblEquipLocations.invoiceID = dbo.tblEquipInvoice.invoiceID INNER JOIN
dbo.tblEquipment ON dbo.vwLatestEquipment.equipServID = dbo.tblEquipment.equipServID INNER JOIN
dbo.tbl_work_locations ON dbo.tblEquipInvoice.workLocationID = dbo.tbl_work_locations.work_id
GROUP BY dbo.tbl_work_locations.work_location, dbo.vwLatestEquipment.equipServID, dbo.tblEquipInvoice.invoiceDateSent, dbo.tblEquipment.equipManafacturer,
dbo.tblEquipInvoice.contractNumber, dbo.tblEquipment.equipmentID, dbo.tblEquipment.equipStatus, dbo.tbl_work_locations.work_location,
dbo.vwLatestEquipment.calibDueDate
ORDER BY dbo.vwLatestEquipment.equipServID
这是我的继任者传给我的,上面的视图可以正常工作,除了它为设备ID的每个项目返回calibDateDue的所有值我想要的是它返回每个项目的最新calibDueDate设备 (equipmentID) 今天任何帮助都将不胜感激,因为我很受煎熬,无法取得太大进展。