只需一步,快速开始
使用道具 举报
mysql> alter table emp add constraint pk_emp_no primary key(emp_no);Query OK, 0 rows affected (3.61 sec)Records: 0 Duplicates: 0 Warnings: 0
mysql> select * from information_schema.TABLE_CONSTRAINTS where TABLE_SCHEMA='employees' and table_name='emp';+--------------------+-------------------+-----------------+--------------+------------+-----------------+| CONSTRAINT_CATALOG | CONSTRAINT_SCHEMA | CONSTRAINT_NAME | TABLE_SCHEMA | TABLE_NAME | CONSTRAINT_TYPE |+--------------------+-------------------+-----------------+--------------+------------+-----------------+| def | employees | PRIMARY | employees | emp | PRIMARY KEY |+--------------------+-------------------+-----------------+--------------+------------+-----------------+1 row in set (0.01 sec)
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )
GMT+8, 2024-11-24 20:58 , Processed in 0.133464 second(s), 21 queries .
重庆思庄学习中心论坛-重庆思庄科技有限公司论坛
© 2001-2020