Created
May 1, 2014 09:58
-
-
Save avwave/13b8a8ea040dcea91e71 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TRIGGER delete_till_max; | |
CREATE TRIGGER delete_till_max INSERT ON recents WHEN (select count(*) from recents)>49 | |
BEGIN | |
DELETE FROM recents WHERE recents.id IN (SELECT recents.id FROM recents ORDER BY recents.id limit (select count(*) -49 from recents )); | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment