国产Oscar数据库实用SQL-随时更新

#获取schame下所有表名

select TABLE_NAME from all_tables WHERE OWNER =‘schamename’;

#获取表结构

SELECT *  where owner=‘schamename‘ AND TABLE_NAME = ‘abctest‘;

#获取主键

select col.column_name from user_constraints con,user_cons_columns col where con.constraint_name=col.constraint_name and con.constraint_type=‘P‘ and col.table_name=‘abctest‘;

国产Oscar数据库实用SQL-随时更新

上一篇:Mysql主从


下一篇:sql