I am using MS SQL database and I have a table named "Logs" that looks like this:
Records are added here one after another so the table becomes quite big after few days/weeks.
What I need to do periodically is a little bit of cleanup. I.e. I need an SQL query that would delete older rows and keep only the most recent 100 records in this table.
I agree it would be better to have it "delete records older than some_date"... It was like this before, but the client wants it different :( So... here we are.
BTW: I'm a little bit disappointed about people throwing negatives on this question. Is there something wrong with it or what?... Imagine: this question produced already 4 answers!!! ... and one guy decided to throw negative on that! Now I really don't know what to think... Strange people around here :(