{SQL}请问几个不常见但有用的查询语句?

EastLine 2004-12-22 01:42:06
1。得到一个数据库中有几个表空间。
2。得到一个表空间中有几张表(及表注释)。
3。得到一个表中的全部字段,字段类型,字段注释。

请大家帮忙,谢谢。
...全文
78 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zmpcoming 2004-12-22
  • 打赏
  • 举报
回复
老大们对系统表很熟悉阿,从那里可以学到这些东西阿?希望授之以渔阿。
EastLine 2004-12-22
  • 打赏
  • 举报
回复
doulikeme(来去无踪) 的方法好像都好用的,谢谢。
ATGC 2004-12-22
  • 打赏
  • 举报
回复
1、select tablespace_name from dba_tablespaces;
2、select a.tablespace_name,a.table_name,b.comments
from dba_tables a,dba_tab_comments b
where a.tablespace_name='你的表空间名'
and a.table_name=b.table_name;
3、dba_tab_colunms或者desc
GerryYang 2004-12-22
  • 打赏
  • 举报
回复
doulikeme(来去无踪) 是对的
doulikeme 2004-12-22
  • 打赏
  • 举报
回复
1.select * from dba_tablespaces;
2.select * from all_tables where TABLESPACE_NAME=upper('tablespace');
表注释 select * from all_tab_comments where table_name=upper('tablename');
3.用desc也行
也可以:
所有列:
select * from all_tab_columns where table_name=upper('tablename');
所有列注释
select * from all_col_comments where table_name=upper('tablename');
子陌红尘 2004-12-22
  • 打赏
  • 举报
回复
3、DESC tablename
luxuezhu 2004-12-22
  • 打赏
  • 举报
回复
1\不能
2、select count(*) from all_tables;
3/ desc table_name;

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧