Is it possible to select from show tables
in MySQL?
SELECT * FROM (SHOW TABLES) AS `my_tables`
Something along these lines, though the above does not work (on 5.0.51a, at least).
Is it possible to select from show tables
in MySQL?
SELECT * FROM (SHOW TABLES) AS `my_tables`
Something along these lines, though the above does not work (on 5.0.51a, at least).
That should be a good start. For more, check INFORMATION_SCHEMA Tables.
in MySql 5.1 you can try
output:
To count:
To list:
Yes, SELECT from table_schema could be very usefull for system administration. If you have lot of servers, databases, tables... sometimes you need to DROP or UPDATE bunch of elements. For example to create query for DROP all tables with prefix name "wp_old_...":
Have you looked into querying INFORMATION_SCHEMA.Tables? As in
You may be closer than you think — SHOW TABLES already behaves a lot like SELECT: