sql语句
1 select column_key 2 from information_schema.columns 3 where table_schema=‘数据库名称‘ and table_name=‘数据表名称‘ and column_name=‘字段名‘;
返回值为:
PRI------->主键约束;
UNI------->唯一约束;
MUL------>可以重复;
空。
查看MySQL 字段KEY值---PRI, UNI, MUL
原文:https://www.cnblogs.com/viavia/p/14959814.html