6.9、union、intersect、exception
来源:互联网 发布:阿里云推荐码10月 编辑:程序博客网 时间:2024/06/05 17:51
复杂集合的处理union、intersect、exception
1 语法
Union(set1, set2[,All]),返回两个集合合并后的集合
Intersect(set1, set2[,All]),返回两个集合交叉部分的集合
Exception(set1, set2[,All]),返回set1中与set2不交叉部分的集合
2 Union示例
select { [Measures].[In Count], [Measures].[Out Count] }on 0 ,union( topCount( [Date].[YearNum].&[2015]*[Date].[Month Num Of Year].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2015]) ), topCount( [Date].[YearNum].&[2016]*[Date].[Month Num Of Year].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2016]) ) ) on 1from [Park]
查询2015年和2016年inCount排前三名的月份
3 Intersect示例
select { [Measures].[In Count], [Measures].[Out Count] }on 0 ,intersect( topCount( [Date].[Month Num OfYear].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2015]) ), topCount( [Date].[Month Num OfYear].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2016]) ) ) on 1from [Park]
查询2015年和2016年的inCount都排名前三的月份
4 Except示例
select { [Measures].[In Count], [Measures].[Out Count] }on 0 ,except( topCount( [Date].[Month Num OfYear].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2016]) ), topCount( [Date].[Month Num OfYear].[Month Num Of Year].members, 3, ([Measures].[InCount], [Date].[Year Num].&[2015]) ) ) on 1from [Park]
查询2016年inCount排前三,且不在2015年inCount排前三的月份
0 0
- 6.9、union、intersect、exception
- Union, Union all, intersect, minus
- Union All/Union/Intersect操作
- union、union all、intersect、minus
- Union、Union All、Intersect、Minus
- UNION,UNION,INTERSECT 與 MINUS
- Union All/Union/Intersect操作
- Union All/Union/Intersect操作
- UNION ,UNION ALL ,INTERSECT ,MINUS
- UNION, INTERSECT, EXCEPT
- UNION ,INTERSECT,MINUS
- UNION-MINUS-INTERSECT-UNIONALL
- oracle union intersect minus
- UNION, INTERSECT, EXCEPT
- 【转】UNION(ALL)/INTERSECT/MINUS
- Oracle union intersect minus 复习
- Linq Concat Union Intersect 区别
- SQL基础--UNION EXCEPT INTERSECT
- 在tomcat服务器中独立部署项目
- Android在app中启动浏览器/打电话/发短信等东西
- ActiveMQ消息的可靠性机制
- MPI Hello World
- YY淘宝商品数据库设计
- 6.9、union、intersect、exception
- Dubbo+Zookeeper+Spring (2)
- C++之内存管理
- 神奇的windows7系统下载啊
- springmvc的各种注解类
- [转]PAT甲级练习1095. Cars on Campus (30)
- javaScript编辑器-HBulider
- 使用 LVS 实现负载均衡原理及安装配置详解
- 【面试题】剑指offer11