Using SQL Server 2000
Table
ID Date Value
001 23-02-2009 300
001 24-02-2009 400
001 25-02-2009 150
002 23-02-2009 300
002 24-02-2009 400
003 23-02-2009 150
.....
.....
From the above table i want to delete the last date for each id.
How to make a query
Expected output
ID Date Value
001 23-02-2009 300
001 24-02-2009 400
002 23-02-2009 300
.....
.....
.....
Need Query Help
You can achieve this by doing a subselect and a join in the
DELETEstatement. For example:Please note that I tested this SQL against SQL Server 2005, but I believe it should work in SQL Server 2000 as well.