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
'프로그래밍 > SQL' 카테고리의 다른 글
[MySQL] Auto Increment 설정하기 (0) | 2023.02.24 |
---|---|
[MySQL] 에러 "ERROR 1267 (HY000): Illegal mix of collations~" (0) | 2023.02.22 |