I want to filter the data in my SQL so that I only have the last row for each thickness where the IsReady field is true.
EDIT: I use the MSSQL 2008 server for anyone who needs to know
My data is as follows:
+--+----------+-----------+----------+-------+ |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 on this data, 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 |
I hope you have enough information so that you can understand, if not just a comment
Jakej source share