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

  • <i id='FLbsM'><tr id='FLbsM'><dt id='FLbsM'><q id='FLbsM'><span id='FLbsM'><b id='FLbsM'><form id='FLbsM'><ins id='FLbsM'></ins><ul id='FLbsM'></ul><sub id='FLbsM'></sub></form><legend id='FLbsM'></legend><bdo id='FLbsM'><pre id='FLbsM'><center id='FLbsM'></center></pre></bdo></b><th id='FLbsM'></th></span></q></dt></tr></i><div id='FLbsM'><tfoot id='FLbsM'></tfoot><dl id='FLbsM'><fieldset id='FLbsM'></fieldset></dl></div>
      <tfoot id='FLbsM'></tfoot>
      <legend id='FLbsM'><style id='FLbsM'><dir id='FLbsM'><q id='FLbsM'></q></dir></style></legend>
        <bdo id='FLbsM'></bdo><ul id='FLbsM'></ul>

        如何在 Oracle 中获取主键列?

        时间:2023-09-18
            <bdo id='1yoa1'></bdo><ul id='1yoa1'></ul>
              <tbody id='1yoa1'></tbody>
            1. <small id='1yoa1'></small><noframes id='1yoa1'>

              <legend id='1yoa1'><style id='1yoa1'><dir id='1yoa1'><q id='1yoa1'></q></dir></style></legend>
              <tfoot id='1yoa1'></tfoot>

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

                  本文介绍了如何在 Oracle 中获取主键列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要获取主键列的名称.

                  I need to get the name of the primary key column.

                  在输入中,我只有表名.

                  In the input, I only have the table name.

                  推荐答案

                  SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
                  FROM all_constraints cons, all_cons_columns cols
                  WHERE cols.table_name = 'TABLE_NAME'
                  AND cons.constraint_type = 'P'
                  AND cons.constraint_name = cols.constraint_name
                  AND cons.owner = cols.owner
                  ORDER BY cols.table_name, cols.position;
                  

                  确保 'TABLE_NAME' 是大写的,因为 Oracle 以大写形式存储表名.

                  Make sure that 'TABLE_NAME' is in upper case since Oracle stores table names in upper case.

                  这篇关于如何在 Oracle 中获取主键列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Oracle SQL 中显示表的所有约束的名称 下一篇:什么是 DBMS 上下文中的 BLOB

                  相关文章

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

                  <small id='yf0kW'></small><noframes id='yf0kW'>

                    1. <tfoot id='yf0kW'></tfoot>