oracle根据列备注查询列

wangyulin_dream 2016-11-25 03:17:06
平时做开发,根据项目需求的列找到oracle表里的字段对应起来。但是oracle一个表里有几百个字段,有时候用到的只有几十个。能根据字段的备注查到某个表里的字段名叫啥吗??
...全文
256 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 10 楼 sych888 的回复:
如果你知道表名,多加个条件就行了 select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.table_name='HT_CG_BUYER' and u.comments like '%这是注释%';
谢谢大神,问题完美解决
sych888 2016-11-25
  • 打赏
  • 举报
回复
如果你知道表名,多加个条件就行了 select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.table_name='HT_CG_BUYER' and u.comments like '%这是注释%';
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 7 楼 wangyulin_dream 的回复:
[quote=引用 6 楼 sych888 的回复:] [quote=引用 3 楼 wangyulin_dream 的回复:] [quote=引用 2 楼 sych888 的回复:] select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??[/quote] select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.comments like '%这是注释%';[/quote] 这样查我把所有表都查出来了,查出来的表名是这种【BIN$+/RJe4n4RYqGFYSh3bsFCg==$0】,我怎么能知道他的名字呢?[/quote]
引用 8 楼 sych888 的回复:
[quote=引用 7 楼 wangyulin_dream 的回复:] [quote=引用 6 楼 sych888 的回复:] [quote=引用 3 楼 wangyulin_dream 的回复:] [quote=引用 2 楼 sych888 的回复:] select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??[/quote] select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.comments like '%这是注释%';[/quote] 这样查我把所有表都查出来了,查出来的表名是这种【BIN$+/RJe4n4RYqGFYSh3bsFCg==$0】,我怎么能知道他的名字呢?[/quote] 这种正常情况下是回收站里面的信息,可以删除 比如你用DROP TABLE TAB_NAME; 此时表不会被直接删除,会先放在回收站了, 你可以用 purge recyclebin; 来清空回收站里的内容[/quote] 嗨呀,这个怪我没表达清楚,我的意思就是说条件能精确到某个表吗?? 比如我现在用的【HT_CG_BUYER】这个表,我想精确到这个表
sych888 2016-11-25
  • 打赏
  • 举报
回复
引用 7 楼 wangyulin_dream 的回复:
[quote=引用 6 楼 sych888 的回复:] [quote=引用 3 楼 wangyulin_dream 的回复:] [quote=引用 2 楼 sych888 的回复:] select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??[/quote] select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.comments like '%这是注释%';[/quote] 这样查我把所有表都查出来了,查出来的表名是这种【BIN$+/RJe4n4RYqGFYSh3bsFCg==$0】,我怎么能知道他的名字呢?[/quote] 这种正常情况下是回收站里面的信息,可以删除 比如你用DROP TABLE TAB_NAME; 此时表不会被直接删除,会先放在回收站了, 你可以用 purge recyclebin; 来清空回收站里的内容
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 6 楼 sych888 的回复:
[quote=引用 3 楼 wangyulin_dream 的回复:] [quote=引用 2 楼 sych888 的回复:] select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??[/quote] select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.comments like '%这是注释%';[/quote] 这样查我把所有表都查出来了,查出来的表名是这种【BIN$+/RJe4n4RYqGFYSh3bsFCg==$0】,我怎么能知道他的名字呢?
sych888 2016-11-25
  • 打赏
  • 举报
回复
引用 3 楼 wangyulin_dream 的回复:
[quote=引用 2 楼 sych888 的回复:] select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??[/quote] select u.table_name "表名",u.column_name "列名" from user_col_comments u where u.comments like '%这是注释%';
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 2 楼 sych888 的回复:
select * from user_col_comments u where u.comments like '%这是注释%';
查到了查到了,谢谢
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 1 楼 wmxcn2000 的回复:


select * from user_col_comments 
还能能详细点吗??
wangyulin_dream 2016-11-25
  • 打赏
  • 举报
回复
引用 2 楼 sych888 的回复:
select * from user_col_comments u where u.comments like '%这是注释%';
我刚才试了下您的sql,发现只能查出表名来,能不能查出制定表里的column名??
sych888 2016-11-25
  • 打赏
  • 举报
回复
select * from user_col_comments u where u.comments like '%这是注释%';
卖水果的net 2016-11-25
  • 打赏
  • 举报
回复


select * from user_col_comments 

3,491

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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