how do i delete a data from table using FIRST IN FIRST OUT (FIFO) method.i have date and ID.
using C# and SQL2008.
解决方案You are confusing yourself! As per comments made you can do a simple delete based on either Date field or ID field.
Assuming you are inserting the records in incremental order for either of the date /ID columns, you can delete the 1st record easily.
In case you are not inserting data in incremental order in any of the fields, you should add a IDENTITY column to your table and delete data based on the value of this identity table.
Hope this helps!
QUOTE: include my application first i add some items in beginning of the month.so i want to remove added item in last of the same month.(i want to firstly remove first added items).so that's why asked how to delete items using FIFO method..
thnx..
Then it seems that you need, in your table, a column holding the date the record was added.
And you can delete the records with specifying this column in your WHERE clause (cannot really give a precise SQL statement as your requirement still seems a little bit obscure to me).
Start from here and come back if you have problems along the way.