Oracle常用的查询语句

1,Oracle 查询表名 comments及列名 comments

导出数据表的时候用到了这个sql记录下来,

select b.comments, a.table_name
  from user_tables a, ALL_TAB_COMMENTS b
 where a.table_name = b.table_name
 order by b.comments, a.table_name

我用的时候改成如下的形式:

select  a.table_name || '(' || b.comments ||')'
  from user_tables a, ALL_TAB_COMMENTS b
 where a.table_name = b.table_name
 order by b.comments, a.table_name

2,

 

 

posted @ 2014-05-28 18:00  心灵@驿站  阅读(171)  评论(0编辑  收藏  举报