Try this: SELECT DISTINCT(ShipRegisterID), MAX(LUpd_DateTime) AS LUpd_DateTime FROM SOShipHeader WHERE ShipRegisterID <> '' AND LUpd_Prog = '40690' GROUP BY ShipRegisterID, LUpd_DateTime ORDER BY ShipRegisterID
↧