What table is the Oracle query field

Source: Internet
Author: User

--The query field in what table

Select *  from where t.column_name='ABC';

--Query What table the field is in and determine if it is a primary key

Select *         fromAll_tab_cols T Left Join (         SelectA.table_name, A.constraint_name, A.column_name, B.constraint_type--field Constraint type (P: primary key)            fromUser_cons_columns aInner Joinuser_constraints b onA.constraint_name=B.constraint_name--and b.constraint_type = ' P ') TC on 1=1           andT.table_name=Tc.table_name andT.column_name=Tc.column_namewhere 1=1        andT.column_name=  'Pk_psndoc'--the field to query        andTc.constraint_type= 'P'  --determines whether the primary key       ORDER  byT.table_name

What table is the Oracle query field

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.