Last active
December 24, 2015 13:31
-
-
Save mattpass/0124b79127da29118857 to your computer and use it in GitHub Desktop.
SQL - get number of rows from last query
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
| SELECT SQL_CALC_FOUND_ROWS *, * FROM huge_table; | |
| /* Then as 2nd query straight after... */ | |
| SELECT FOUND_ROWS() AS totalRows; | |
| /* ...to get total records found */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment