java如何在oracle中定义表上的默认where子句
有些查询的where子句具有相同的部分
问题一:
select [some-selected column]
from [TABLE_NAME]
where [its-own-where-clause]
and [shared-where-clause]
问题二:
select [some-selected column]
from [TABLE_NAME]
where [its-own-where-clause]
and [shared-where-clause]
问题三:
select [some-selected column]
from [TABLE_NAME]
where [its-own-where-clause]
and [shared-where-clause]
.
.
.
查询n:
select [some-selected column]
from [TABLE_NAME]
where [its-own-where-clause]
and [shared-where-clause]
正如您所看到的,where子句中有两部分,第一部分属于它自己的查询业务,第二部分在所有这些查询之间共享
显然,当[shared-where-clause]
发生更改时,必须更改上述所有查询
我想把where子句的shared部分放在其中,它的更改应用于所有这些查询
在甲骨文中可能吗
# 1 楼答案
创建一个视图
例如:
现在我们可以查询不同年龄组的男性,而无需重复
GENDER
上的共享条件