Potrzebuję dodać wiele kolumn do tabeli, ale ustaw kolumny po kolumnie o nazwie lastname
.alter table dodaj kolumny MULTIPLE AFTER column1
Próbowałem to:
ALTER TABLE `users` ADD COLUMN
(
`count` smallint(6) NOT NULL,
`log` varchar(12) NOT NULL,
`status` int(10) unsigned NOT NULL
)
AFTER `lastname`;
otrzymuję ten błąd:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AFTER
lastname
' at line 7
Jak mogę używać po w zapytaniu jak to?
Co dialekt mówisz? Wygląda mi na mysql. Ale składnia 'ALTER TABLE' różni się nieco między dialektami. –
Przepraszam, tak, mysql. – Koala
możliwy duplikat [Zmienna MySQL Dodaj pole Przed lub po polu już obecnym] (http://stackoverflow.com/questions/3379454/mysql-alter-table-add-field-before-or-after-a-field -already-present) –