Reputation: 426
I would like to apply pagination to the results of SHOW TABLES FROM DATABASE_NAME
.
Tried using the LIMIT
keyword but an error is thrown.
By pagination I mean that the result(tables) returned by the query is to be displayed on multiple pages.
Upvotes: 13
Views: 17530
Reputation: 7778
You can try following
1)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'database_name'
AND TABLE_NAME LIKE "a%"
LIMIT 0,20;
2)
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'database_name'
LIMIT 0,50;
Upvotes: 0
Reputation: 125476
you can use the different query instead (an achieve the names of the tables) like:
SELECT TABLE_NAME FROM information_schema.TABLES
WHERE `TABLE_SCHEMA` = 'my_db_name' LIMIT 10
Upvotes: 22