Changing the type of a primary key column

suggest change
ALTER TABLE fish_data.fish DROP PRIMARY KEY;
ALTER TABLE fish_data.fish MODIFY COLUMN fish_id DECIMAL(20,0) NOT NULL PRIMARY KEY;

The MODIFY above includes PRIMARY KEY. Doing that while a primary key still exists raises “Multiple primary key defined”, so drop it first. To change only the type and keep the existing key, omit PRIMARY KEY from the MODIFY.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents