프로그래밍/SQL
[빅쿼리] 테이블 구조 확인 / DESC 명령 에러
김뎀뎀
2023. 9. 22. 15:14
python에서 빅쿼리를 연동하여 DESC 명령으로 테이블 구조를 확인하려 했으나 에러 발생!
구글링을 통해 해결했는데, 아래와 같이 작성하면 된다!
SELECT column_name, is_nullable, data_type
FROM `olist.INFORMATION_SCHEMA.COLUMNS` # db명 작성(olist 부분에 사용하는 db명으로 작성하면 된다)
WHERE table_name='customers' # table 명 작성
아래 글을 참고하였다
getting the description of a table using Google bigquery
I am new to bigquery. First thing, I would have liked to do the SQL equivalent of DESC using Google bigquery. I did: DESC `paj.dw.MY_TABLE`; But I get: Statement not supported: DescribeStatement
stackoverflow.com