84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
使用information_schema.table_constraints表格來取得每個表格上定義的約束的名稱:
information_schema.table_constraints
select * from information_schema.table_constraints where constraint_schema = 'YOUR_DB'
使用information_schema.key_column_usage表來取得這些約束中的欄位:
information_schema.key_column_usage
select * from information_schema.key_column_usage where constraint_schema = 'YOUR_DB'
如果您要討論外鍵約束,請使用information_schema.referential_constraints:
information_schema.referential_constraints
select * from information_schema.referential_constraints where constraint_schema = 'YOUR_DB'
使用
information_schema.table_constraints
表格來取得每個表格上定義的約束的名稱:使用
information_schema.key_column_usage
表來取得這些約束中的欄位:如果您要討論外鍵約束,請使用
information_schema.referential_constraints
: