Oracle查询库中的所有表,表的字段等等操作
2017-07-07 17:39
197 查看
查询数据库的所有表
select * from user_tables
查询数据库的某个表名为XXX
select * from user_tables where tablespace_name = 'TIM_MIS_BASE'
查询所有表名:
select t.table_name from user_tables t;
查询所有字段名:
select t.column_name from user_col_comments t;
查询指定表的所有字段名:
select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';
查询指定表的所有字段名和字段说明:
select t.column_name, t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';
查询所有表的表名和表说明:
select t.table_name,f.comments from user_tables t inner join user_tab_comments f on t.table_name = f.table_name;
查询模糊表名的表名和表说明:
select t.table_name from user_tables t where t.table_name like 'BIZ_DICT%';
select t.table_name,f.comments from user_tables t inner join user_tab_comments f on t.table_name = f.table_name where t.table_name like 'BIZ_DICT%';
--查询表的数据条数、表名、中文表名
select a.num_rows, a.TABLE_NAME, b.COMMENTS
from user_tables a, user_tab_comments b
WHERE a.TABLE_NAME = b.TABLE_NAME
order by TABLE_NAME;
其他参考资料:http://www.cnblogs.com/hyq0002013/p/5948419.html
select * from user_tables
查询数据库的某个表名为XXX
select * from user_tables where tablespace_name = 'TIM_MIS_BASE'
查询所有表名:
select t.table_name from user_tables t;
查询所有字段名:
select t.column_name from user_col_comments t;
查询指定表的所有字段名:
select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';
查询指定表的所有字段名和字段说明:
select t.column_name, t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';
查询所有表的表名和表说明:
select t.table_name,f.comments from user_tables t inner join user_tab_comments f on t.table_name = f.table_name;
查询模糊表名的表名和表说明:
select t.table_name from user_tables t where t.table_name like 'BIZ_DICT%';
select t.table_name,f.comments from user_tables t inner join user_tab_comments f on t.table_name = f.table_name where t.table_name like 'BIZ_DICT%';
--查询表的数据条数、表名、中文表名
select a.num_rows, a.TABLE_NAME, b.COMMENTS
from user_tables a, user_tab_comments b
WHERE a.TABLE_NAME = b.TABLE_NAME
order by TABLE_NAME;
其他参考资料:http://www.cnblogs.com/hyq0002013/p/5948419.html
相关文章推荐
- 这里我们介绍的是 40+ 个非常有用的 Oracle 查询语句,主要涵盖了日期操作,获取服务器信息,获取执行状态,计算数据库大小等等方面的查询。这些是所有 Oracle 开发者都必备的技能,所以快快收藏吧!
- oracle查询所有表和字段
- oracle 中查询一个表的所有字段名以及属性的sql语句应该怎么写?
- 用select 查询表中所有的字段名 Oracle开发应用
- oracle查询所有字段的类型
- ORACLE 查询所有表,某个表的字段和所有表的字段和注释
- Oracle 查询一个表的所有字段
- oracle通过表中2个字段分组查询取数量最大的所有记录,有条件的去重
- 折腾Oracle问题小菜记[分页存储过程/查询所有表、视图、存储过程/查询表、视图、存储过程字段结构与参数](三)
- 【转】Oracle 查询库中所有表名、字段名、表名说明、字段名说明
- oracle 查询所有表和字段
- ORACLE中查询系统中的所有表和查询某张表中所有字段的名称的SQL写法
- Oracle树查询(查询所有子节点,父节点等等)
- oracle根据字段值查询所有表及其字段.txt
- oracle 查询包含某字段的所有表
- Oracle树查询(查询所有子节点,父节点等等)_转载
- 数据库编程3 Oracle 子查询 insert update delete 事务 回收站 字段操作 企业级项目案例
- oracle查询所有表和字段
- 在oracle中查询已知表名的表中所有字段名,每个字段是否是主键,是否是外键,是否为空的sql语句