I made automated test GUI's using labview that test our 8 channel devices. Each time a test is completed, 8 rows are automatically added to a SQL Server table, and all of these 8 rows have the same Serial number recorded. Every time a test is done, 8 rows are added regardless of whether this serial number has already been tested. What I want to do is get the most recent data (always 8 Lines) for all the unique Serial Numbers.
So far I have only been able to do this for single line entry tests using the following code:
SELECT TestIndex
FROM dbo.TROSA_101_InitialTestingLD_AsicLpTest_CH
WHERE TestIndex IN (SELECT MAX(TestIndex) FROM dbo.TROSA_101_InitialTestingLD_AsicLpTest_CH GROUP BY SerialNumber)
Essentially I just want to remove the duplicate sets of 8 lines of data(each corresponding to one test) or in other words get the most recent 8 lines for each unique SerialNumber
value.