Description

This statement is used to view all the views under the specified schema. Similar to the SHOW TABLES statement, but limited by the WHERE condition to only display views. This helps users quickly understand the structure and information of views in a specific schema.

Syntax

SHOW TABLES [IN schema_name] [LIKE 'pattern' | WHERE expr]

Parameter Description

  1. LIKE pattern (optional): Filter by object name using case-insensitive pattern matching. Supports SQL wildcards % (matches any sequence of characters, including an empty sequence) and _ (matches any single character). For example: LIKE '%testing%'. Note that the LIKE clause cannot be used simultaneously with the WHERE clause.

  2. IN schema_name (optional): Specify the schema name to list the views under the specified schema. If schema_name is not specified, the views in the default schema of the current user are displayed.

  3. WHERE expr (optional): Filter based on the fields displayed by the SHOW TABLES statement. Users can filter using field names and corresponding conditions according to their actual needs. LIKE and WHERE cannot be used simultaneously.

Usage Example

  1. View all views in the current schema:

    SHOW TABLES WHERE is_view=true;
  2. View all views under a specified schema (for example: my_schema):

    SHOW TABLES IN my_schema WHERE is_view=true;