Thursday, December 31, 2020

DROP KEY CONSTRAINT IN MYSQL

Step1 : Firstly you have to take backup current table .

create table tb_old like tb_new
insert into tb_new select * from tb_old

Step2:

# rename table tb_old   to  tb_new ; 

Step3: alter table tbl_new  drop  KEY tbl_UNQ_KEY_ID  (drop key from table) 

 # rename table tb_new   to  tb_old ;

No comments:

Post a Comment

How to Find the Third highest salary in mysql

  set @b:=0; set @b1:=3;   # #select distinct salary,@b:=@b+1 as Row_no from emp select  * from emp where salary=( select salary from ( sele...