How to get column count from a table in teradata?

Member

by orpha , in category: MySQL , 20 days ago

How to get column count from a table in teradata?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by ryan.murray , 19 days ago

@orpha 

To get the column count from a table in Teradata, you can use the following SQL query:

1
2
3
4
5
6
7
SELECT 
    COUNT(*) AS column_count
FROM
    dbc.ColumnsV
WHERE
    DatabaseName = 'your_database_name'
    AND TableName = 'your_table_name';


Replace 'your_database_name' with the name of the database where your table is located and 'your_table_name' with the name of the table you want to get the column count for.


This query will return the total number of columns in the specified table.