How do I show unique constraints of a table in MySQL?

前端 未结 5 652
庸人自扰
庸人自扰 2020-12-05 17:33

I created them, but I forgot which ones they are.

I just want to

  1. show them.
  2. remove all the constraints on a table.
5条回答
  •  一生所求
    2020-12-05 18:02

    select distinct CONSTRAINT_NAME
    from information_schema.TABLE_CONSTRAINTS
    where table_name = 'table_name' and constraint_type = 'UNIQUE';
    

提交回复
热议问题