Created
October 22, 2011 22:50
-
-
Save ctcherry/1306594 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
SET @rows = 5; | |
SET @c = (SELECT COUNT(id) FROM table); | |
SET @c = @c - @rows; | |
SET @s = CONCAT("SELECT * FROM table LIMIT ", @c, ",", @rows); | |
PREPARE stmt FROM @s; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment