How to get the record which is marked in red ?
Note : there is many BaaN product , I have put an example showing with 2 Baan Product .
Technology Tips and News
How to get the record which is marked in red ?
Note : there is many BaaN product , I have put an example showing with 2 Baan Product .
Try the below:
;With cte as (Select *, Row_Number()Over(partition by BaaN Order by [Contract Start Date] desc) Rn From Tablename) Select * From cte where rn=1
SELECT t.* FROM Table t WHERE NOT EXISTS ( SELECT 1 FROM Table WHERE TENDER = t.TENDER AND BaaN = t.BaaN AND [CONTRACT START DATE] > t.[CONTRACT START DATE] )