When we need those table which does not have specific column name in their table structure.
To retrieve information about column exits in table ,we specify the fully qualified name of INFORMATION_SCHEMA.columns
select distinct table_name From information_schema.columns
except
select distinct table_name From information_schema.columns where column_name like 'Your Column Name'
except
select distinct table_name From information_schema.columns where column_name like 'Your Column Name'
You can also find all tables in a db that have a certain column name.
select
distinct table_name From information_schema.columns where column_name like
'Your Column Name'
* EXCEPT returns any distinct values from the left query that are not also found on the right query.
* Replace 'Your Column Name' with your search column name.
Comments
Post a Comment