Find tables with specific column name in Vertica database

Query below finds all tables that have 'last_name' column.

See also tables that don't have a column with specific name.

Query

select table_schema,
       table_name
from v_catalog.columns
where column_name = 'last_name'
order by table_schema,
         table_name;

Columns

  • table_schema - name of schema of found table
  • table_name - name of found table

Rows

  • One row represents a table
  • Scope of rows: all found tables
  • Ordered by table schema

Sample results

List of tables that have 'last_name' column.

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.