Add primary key to existing table

后端 未结 10 1578
生来不讨喜
生来不讨喜 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:20

    If you add primary key constraint

    ALTER TABLE  ADD CONSTRAINT  PRIMARY KEY   
    
    
    

    for example:

    ALTER TABLE DEPT ADD CONSTRAINT PK_DEPT PRIMARY KEY (DEPTNO)
    

    提交回复
    热议问题