Is there a better way to rewrite below code without using DISTINCT operator. Other thing, is that I don't see any duplicates inside the table. But not sure in future if we get duplicate combination. that could be reason why some developer has written such type of code. Can we re-write this code in a better way??
select distinct top (1) [x].[DateDrawn] ,[x].[EquipmentLife] ,[x].[LubricantLife] ,[x].[DateRegistered] ,[x].[SampleID] FROM [LubeAnalyst].[Sample] AS [x] WHERE [x].[SampleStatusID] = 1
By Maahi 1 asked Dec 21, 2017 at 08:41 PM