I want to limit the number of rows in x table. Let say in x table have 3 records r1, r2 and r3 when new record is available for insertion then r3 should be deleted and new record should be added so the total number of rows always remain 3 ...
Asked
Active
Viewed 183 times
0
-
You can run delete query and then run the insert query for new record. – mubeen Nov 01 '15 at 18:58
-
Or simply **update** the last record, instead of deleting and reinserting it. – Phantômaxx Nov 01 '15 at 19:05
1 Answers
0
You need LRU Disk (Last recently used) mechanism. There are lots of LRU libraries that can read and write from disk. Here is a one of them.

Emre Aktürk
- 3,306
- 2
- 18
- 30