MYSQL Studio 사용해서 쿼리 작성중 입니다.
테이블에 열을 추가하려고 하는데 옵션이 안먹히네요.
ALTER TABLE N_Filter ADD TZ_PROCESS_TIME NVARCHAR(50) Null AFTER GMT_PROCESS_TIME;
이 경우 AFTER 문자 밑에 에러표시가 나타나고 실행시키면 'AFTER' 근처의 구문이 잘못되었습니다."라는 에러가 발생합니다.
ALTER TABLE N_Filter MODIFY PROCESS_TIME AFTER GMT_PROCESS_TIME;
이 경우 MODIFY 문자 밑에 에러표시가 나타나고 실행시키면 'MODIFY' 근처의 구문이 잘못되었습니다."라는 에러가 발생합니다.
AFTER와 MODIFY가 왜 인식이 안될까요 ?
감사합니다.
mysql studio를 쓰지 않아서 잘 모르겠지만 터미널에서는 잘 되는 것 같습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | [root@db1 ~]# mysql -u root -p test Enter password : Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and / or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and / or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> DROP TABLE N_Filter; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE N_Filter (PROCESS_TIME NVARCHAR(50), GMT_PROCESS_TIME NVARCHAR(50)); Query OK, 0 rows affected (0.01 sec) mysql> desc N_Filter; + ------------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | + ------------------+-------------+------+-----+---------+-------+ | PROCESS_TIME | varchar (50) | YES | | NULL | | | GMT_PROCESS_TIME | varchar (50) | YES | | NULL | | + ------------------+-------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) mysql> ALTER TABLE N_Filter ADD TZ_PROCESS_TIME NVARCHAR(50) Null AFTER GMT_PROCESS_TIME; Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> desc N_Filter; + ------------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | + ------------------+-------------+------+-----+---------+-------+ | PROCESS_TIME | varchar (50) | YES | | NULL | | | GMT_PROCESS_TIME | varchar (50) | YES | | NULL | | | TZ_PROCESS_TIME | varchar (50) | YES | | NULL | | + ------------------+-------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> ALTER TABLE N_Filter MODIFY PROCESS_TIME NVARCHAR(50) AFTER GMT_PROCESS_TIME; Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> desc N_Filter; + ------------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | + ------------------+-------------+------+-----+---------+-------+ | GMT_PROCESS_TIME | varchar (50) | YES | | NULL | | | PROCESS_TIME | varchar (50) | YES | | NULL | | | TZ_PROCESS_TIME | varchar (50) | YES | | NULL | | + ------------------+-------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) |