LMSouq
general-dev Open

Adding multiple columns after a specific column with a single ADD COLUMN statement results in a syntax error

KO
Koala
1 month ago
3 views
Problem Description
I need to add multiple columns to a table but position the columns **after** a column called `lastname`. I have tried this: ALTER TABLE `users` ADD COLUMN ( `count` smallint(6) NOT NULL, `log` varchar(12) NOT NULL, `status` int(10) unsigned NOT NULL ) AFTER `lastname`; I get this error: > 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 <br> How can I use AFTER in a query like this?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base