select cut_start_date,cut_end_date from table_A
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_date
union
select cut_start_date,cut_end_date from table_B
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_dateselect up_start_date,up_end_date from table_C
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date
union
select up_start_date,up_end_date from table_D
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date这两个union连接的select语句的查询结果不同,但是我想把这两个union的语句连接到一起不知道用什么关键字,能够查询出满足任其中的一个union条件,希望各位高手帮帮忙!
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_date
union
select cut_start_date,cut_end_date from table_B
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_dateselect up_start_date,up_end_date from table_C
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date
union
select up_start_date,up_end_date from table_D
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date这两个union连接的select语句的查询结果不同,但是我想把这两个union的语句连接到一起不知道用什么关键字,能够查询出满足任其中的一个union条件,希望各位高手帮帮忙!
解决方案 »
- oracle如何建立字母开头并且自动增长的主键,如yy00001,yy00002,yy00003,以此类推
- 求高手解释什么是数据完整性和一致性
- 一个小小的合并问题
- sql loader 导入数据的时候出问题了!在线等待中。。。
- 求助怎样用C#将oracle中的表以excel的形式显示在winform中啊
- 如何用PL/SQL develop工具连接局域网上的Oracle数据库?
- SOS:::toad能不能显示日文??????
- 100分求助csdn的ggjj(oracle 连接问题)
- oracle 存储过程中数值转换问题
- 发现变了星,放分.
- 如何写SQL将Oracle中的字典表DBA_TAB_COMMENTS导出为CSV文件 最高分给。。
- 小问题,大家来抢分吧!
--可以稍微修改下
select cut_start_date,cut_end_date from table_A
where cut_start_date<=sysdate and cut_end_date>=sysdate
union
select cut_start_date,cut_end_date from table_B
where cut_start_date<=sysdate and cut_end_date>=sysdate
select cut_start_date,cut_end_date from table_A
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_date
union
select cut_start_date,cut_end_date from table_B
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_dateunion allselect up_start_date,up_end_date from table_C
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date
union
select up_start_date,up_end_date from table_D
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date
(...)
union all
(...)
(select cut_start_date,cut_end_date from table_A
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_date
union
select cut_start_date,cut_end_date from table_B
where (select sysdate from dual)>=cut_start_date and (select sysdate from dual)<=cut_end_date)
union / union all --union 排序去重 union all 不排序不去重
(select up_start_date,up_end_date from table_C
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date
union
select up_start_date,up_end_date from table_D
where (select sysdate from dual)>=up_start_date and (select sysdate from dual)<=up_end_date)