Skip to main content
added 234 characters in body
Source Link
MaxU - stand with Ukraine
  • 211.8k
  • 37
  • 402
  • 436

You need to add a primary key just once. You can do it this way:

if your want to add a new column as a PK (Primary Key):

alter table KLSE add id int primary key auto_increment;

if your table already has a column which you are going to use as a PK (Primary Key):

alter table KLSE modify ID<existing_column_name> int auto_increment primary key;

You need to add a primary key just once. You can do it this way:

alter table KLSE modify ID int auto_increment primary key;

You need to add a primary key just once. You can do it this way:

if your want to add a new column as a PK (Primary Key):

alter table KLSE add id int primary key auto_increment;

if your table already has a column which you are going to use as a PK (Primary Key):

alter table KLSE modify <existing_column_name> int auto_increment primary key;
Source Link
MaxU - stand with Ukraine
  • 211.8k
  • 37
  • 402
  • 436

You need to add a primary key just once. You can do it this way:

alter table KLSE modify ID int auto_increment primary key;