'How do I select the columns of a table in databricks sql?
I can use: show columns in table_name but this does not allow me to use the output in a query?
This throws an error:
SELECT * FROM show columns in table_name
Solution 1:[1]
Show columns: Returns the list of columns in a table. If the table does not exist, an exception is thrown.
Select clause can be part of a query which also includes common table expressions (CTE), set operations, and various other clauses. With SELECT clause you simply provide the column names that you want to work with operations and various another clause.
You can select specific columns by following command:
SELECT Column_Name FROM Table_Name;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PratikLad-MT |