프로그래밍/SQL3 [빅쿼리] 테이블 구조 확인 / DESC 명령 에러 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.. 2023. 9. 22. [MySQL] Auto Increment 설정하기 sql에서 테이블에 데이터가 추가될 때, 특정 컬럼은 자동으로 1씩 증가되는 설정을 줄 수 있다. 테이블을 생성할 때 컬럼에 Auto Increment 옵션을 주면 된다. fruit라는 테이블을 생성하고, id 컬럼에 auto_increment 옵션을 넣는다 CREATE TABLE fruit ( id int NOT NULL AUTO_INCREMENT, name varchar(12), PRIMARY KEY (id) ); DESC fruit; fruit 테이블에 name 컬럼 데이터만 넣어주면, id는 자동으로 값이 매겨진다. INSERT INTO fruit (name) VALUES ('apple'); INSERT INTO fruit (name) VALUES ('lemon'); INSERT INTO frui.. 2023. 2. 24. [MySQL] 에러 "ERROR 1267 (HY000): Illegal mix of collations~" ⚠️ 에러 발생 상황 SELECT c.police_station, p.name FROM crime_status c, police_station p WHERE p.name LIKE CONCAT('서울',c.police_station,'경찰서') GROUP BY c.police_station, p.name' ``` ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation 'like' ``` police_station 테이블의 name 컬럼을 crime_station 테이블의 poilce_station 컬럼과 문자열을 조합해 LIKF로 비교하려 했.. 2023. 2. 22. 이전 1 다음