本文介绍了根据两个数据库表之间的数据比较创建oracle视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有下表:
- 我想创建视图,以便对于
descr = 'O'
和两个表中的公共id_isin
字段值,检查ratio
字段并仅取ratio
字段值较低的行. - 对于
descr = 'O'
并且如果 id_isin 存在于一个表中但不在另一个表中,则取那些行(双向) - 对于
descr != 'O'
,从表IS_ID_TST
中取出所有这些行.
- I want to create View such that for
descr = 'O'
and for commonid_isin
field value from both tables, check theratio
field and take only the row whereratio
field value is low. - for
descr = 'O'
and if the id_isin exist in one table but not in another then take those rows(bidirectional) - For all the rows where
descr ! = 'O'
, take all those rows from tableIS_ID_TST
.
以下是视图的预期输出,例如:
Below is the expected output from view for example:
我可以根据这个条件创建视图吗?
Can i create View based on this conditions ?
推荐答案
我提出了以下查询,请检查我已对查询发表评论.询问是否不符合您的要求或进行任何澄清.
I have come up with below query, Please check I have put comments on the query. Ask if doesn't meet you r requirement or for any clarification.
这篇关于根据两个数据库表之间的数据比较创建oracle视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!