column name information in databricks

Vineet S 750 Reputation points
2024-03-03T16:24:08.76+00:00

Hey,

how to find particular column name information in datarbricks

example

SELECT s.name, t.name, c.name

FROM sys.columns c

JOIN sys.tables t ON c.object_id = t.object_id

JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE c.name LIKE '%mob%'

how we can convert this query in databricks

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,151 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 21,085 Reputation points
    2024-03-03T17:54:47.26+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    In Databricks, you can achieve similar functionality using the INFORMATION_SCHEMA.COLUMNS view, which provides metadata about columns in tables.

    SELECT table_schema AS schema_name, table_name, column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE column_name LIKE '%mob%'

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.