Reputation: 87
I want to get all columns' names that have a specific type, for example I want to print all the columns' names with int type. How do I do that?
Upvotes: 1
Views: 299
Reputation:
You can use information_schema.columns for that:
select table_schema, table_name, column_name
from information_schema.columns
where data_type = 'integer';
Upvotes: 3