Reputation: 5441
I've lot of tables in my database and I wanted to know if there is any way I can get all the tables names that start with a certain string.
For example, I have this string: my_table
and I would like to get all of the tables names that starts with it. The expected result would be my_table_*
so it's pretty much everything that starts with it.
Is it possible?
Thanks in advance!
Upvotes: 0
Views: 2555
Reputation: 352
SELECT table_name
FROM information_schema.tables
WHERE table_name LIKE 'string_here%';
Should do the trick
Upvotes: 4