• <small id='Obgdd'></small><noframes id='Obgdd'>

    1. <legend id='Obgdd'><style id='Obgdd'><dir id='Obgdd'><q id='Obgdd'></q></dir></style></legend>
    2. <i id='Obgdd'><tr id='Obgdd'><dt id='Obgdd'><q id='Obgdd'><span id='Obgdd'><b id='Obgdd'><form id='Obgdd'><ins id='Obgdd'></ins><ul id='Obgdd'></ul><sub id='Obgdd'></sub></form><legend id='Obgdd'></legend><bdo id='Obgdd'><pre id='Obgdd'><center id='Obgdd'></center></pre></bdo></b><th id='Obgdd'></th></span></q></dt></tr></i><div id='Obgdd'><tfoot id='Obgdd'></tfoot><dl id='Obgdd'><fieldset id='Obgdd'></fieldset></dl></div>
    3. <tfoot id='Obgdd'></tfoot>
        <bdo id='Obgdd'></bdo><ul id='Obgdd'></ul>

        MySQL 数据库中的约束列表

        时间:2023-11-28
        <i id='yOyAr'><tr id='yOyAr'><dt id='yOyAr'><q id='yOyAr'><span id='yOyAr'><b id='yOyAr'><form id='yOyAr'><ins id='yOyAr'></ins><ul id='yOyAr'></ul><sub id='yOyAr'></sub></form><legend id='yOyAr'></legend><bdo id='yOyAr'><pre id='yOyAr'><center id='yOyAr'></center></pre></bdo></b><th id='yOyAr'></th></span></q></dt></tr></i><div id='yOyAr'><tfoot id='yOyAr'></tfoot><dl id='yOyAr'><fieldset id='yOyAr'></fieldset></dl></div>
          <tbody id='yOyAr'></tbody>
      1. <small id='yOyAr'></small><noframes id='yOyAr'>

          <bdo id='yOyAr'></bdo><ul id='yOyAr'></ul>

            <tfoot id='yOyAr'></tfoot>

              <legend id='yOyAr'><style id='yOyAr'><dir id='yOyAr'><q id='yOyAr'></q></dir></style></legend>
                  本文介绍了MySQL 数据库中的约束列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何从特定数据库中获取所有约束的列表?

                  How do I get a list of all constraints from a particular database?

                  推荐答案

                  使用 information_schema.table_constraints 表以获取每个表上定义的约束的名称:

                  Use the information_schema.table_constraints table to get the names of the constraints defined on each table:

                  select *
                  from information_schema.table_constraints
                  where constraint_schema = 'YOUR_DB'
                  

                  使用information_schema.key_column_usage 表以获取每个约束中的字段:

                  Use the information_schema.key_column_usage table to get the fields in each one of those constraints:

                  select *
                  from information_schema.key_column_usage
                  where constraint_schema = 'YOUR_DB'
                  

                  如果您正在谈论外键约束,请使用 information_schema.referential_constraints:

                  If instead you are talking about foreign key constraints, use information_schema.referential_constraints:

                  select *
                  from information_schema.referential_constraints
                  where constraint_schema = 'YOUR_DB'
                  

                  这篇关于MySQL 数据库中的约束列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在数据库中添加新行时,必须调用外部命令行程序 下一篇:ON [PRIMARY] 是什么意思?

                  相关文章

                1. <legend id='3P38R'><style id='3P38R'><dir id='3P38R'><q id='3P38R'></q></dir></style></legend>

                    <bdo id='3P38R'></bdo><ul id='3P38R'></ul>
                2. <i id='3P38R'><tr id='3P38R'><dt id='3P38R'><q id='3P38R'><span id='3P38R'><b id='3P38R'><form id='3P38R'><ins id='3P38R'></ins><ul id='3P38R'></ul><sub id='3P38R'></sub></form><legend id='3P38R'></legend><bdo id='3P38R'><pre id='3P38R'><center id='3P38R'></center></pre></bdo></b><th id='3P38R'></th></span></q></dt></tr></i><div id='3P38R'><tfoot id='3P38R'></tfoot><dl id='3P38R'><fieldset id='3P38R'></fieldset></dl></div>

                    1. <tfoot id='3P38R'></tfoot>

                      <small id='3P38R'></small><noframes id='3P38R'>