I want to filter the data in my SQL so that I only have the latest row for each thickness where the IsReady field is true.
EDIT: I’m using MSSQL 2008 server for all who need to know
My data is like this:
+--+----------+-----------+----------+-------+
|ID|SupplierID|ThicknessID|DateTime |IsReady|
+--+----------+-----------+----------+-------+
|01|1 |1 |01/01/1990|1 |
|02|1 |1 |01/01/2012|0 |
|03|1 |2 |01/01/1990|1 |
|04|1 |2 |01/01/2012|1 |
Based off this data provided, the SQL code should return the following:
+--+----------+-----------+----------+-------+
|ID|SupplierID|ThicknessID|DateTime |IsReady|
+--+----------+-----------+----------+-------+
|01|1 |1 |01/01/1990|1 |
|04|1 |2 |01/01/2012|1 |
Hope this is enough information for you to understand, if not just comment
1 Answer