oracle中知道表得到其主键的sql语句

    技术2022-05-11  60

    select   TC.table_name   ,   TC.column_name   ,C.constraint_type c.constraint_name     from   USER_TAB_COLUMNS   TC,USER_CONS_COLUMNS   CC   ,user_constraints   C     where   TC.table_name   =   'TABLE1'     and   TC.table_name   =   CC.table_name(+)     and   TC.column_name   =   CC.column_name   (+)     and   CC.constraint_name   =   C.constraint_name(+)     and   c.constraint_type   =   'P';   

    最新回复(0)