Reputation: 227
How to get a list of all the columns inside a bigquery table which contain a particular keyword? For eg. Say the table has following columns:
Name | Age | Address | School_Name | School_Address | School_PhoneNo | etc. I want the names of all the columns which contain the string 'School'. The required result would be:
Upvotes: 1
Views: 377
Reputation: 207912
You need to run a query like
SELECT
column_name
FROM
`bigquery-public-data`.census_bureau_usa.INFORMATION_SCHEMA.COLUMNS
WHERE
column_name like '%age%' and table_name='population_by_zip_2000'
This returns:
Upvotes: 2