programing

마리아에서 열 이름 변경DB

itsource 2023. 1. 17. 21:25
반응형

마리아에서 열 이름 변경DB

이 데이터베이스에는 스페이스바가 포함된 컬럼이 있습니다.이 컬럼을 변경하고 싶습니다.

ALTER TABLE . CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11); 

명령줄에서 이 행을 사용하면 다음과 같이 출력됩니다.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11)' at line 1

그래, 나도 내가 뭘 잘못하고 있는지 모르겠어.

테이블명 대신에 점(.)을 사용하고 있는 경우는, 에러가 발생합니다.테이블 이름을 지정해야 합니다.

ALTER TABLE `table_name` CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);

ALTER TABLE <table_name> CHANGE COLUMN old_name new_name column_definition

https://jira.mariadb.org/browse/MDEV-16290

언급URL : https://stackoverflow.com/questions/28507987/change-column-name-in-mariadb

반응형