Add primary key to existing table

后端 未结 10 1568
生来不讨喜
生来不讨喜 2020-12-07 11:40

I have an existing table called Persion. In this table I have 5 columns:

  • persionId
  • Pname
  • PMid
  • Pdescription
  • Pa
10条回答
  •  情话喂你
    2020-12-07 12:32

    Please try this-

    ALTER TABLE TABLE_NAME DROP INDEX `PRIMARY`, ADD PRIMARY KEY (COLUMN1, COLUMN2,..);
    

提交回复
热议问题