This is my current SQL query:
SELECT
ROW_NUMBER() OVER(PARTITION BY [Machine_ID] ORDER BY Version DESC) AS ROW,
MachineList.*
FROM
MachineList
Basically, I want to get distinct machine information. If several machines have the same ID, then choose the one with latest version.
However, SQL Server 2000 does not support the ROW_Number function. Is there any alternative for the SQL above?
P.S. most solutions I found on line are using temp table. But I could not use temp table because this query will be used in SSIS.
1 Answer