sql server 2008语言基础: 集合
2012-04-11 13:28
323 查看
--declare @t table(n int) --insert into @t values(0),(1),(2),(3),(4),(5),(6),(7),(8),(9) --select * from @t --返回在2008年1月有订单活动, 而在08年2月没有订单活动的客户和雇员. --select custid, empid from Sales.Orders where orderdate>='2008-01-01' and orderdate<'2008-02-01' --except --select custid, empid from Sales.Orders where orderdate>='2008-02-01' and orderdate<'2008-03-01' --返回在08年1月和2月都有订单活动的客户和雇员 --select custid, empid from Sales.Orders where orderdate>='2008-01-01' and orderdate<'2008-02-01' --intersect --select custid, empid from Sales.Orders where orderdate>='2008-02-01' and orderdate<'2008-03-01' --在08年1月和2月有, 在07年没有的客户和雇员 --(select custid, empid from Sales.Orders where orderdate>='2008-01-01' and orderdate<'2008-02-01' --intersect --select custid, empid from Sales.Orders where orderdate>='2008-02-01' and orderdate<'2008-03-01' --) --except --select custid, empid from Sales.Orders where orderdate>='2007-1-01' and orderdate<'2008-01-01' select country,region,city from hr.Employees union all select country,region,city from Production.Suppliers
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
相关文章推荐
- 笔记-Microsoft SQL Server 2008技术内幕:T-SQL语言基础-06 集合运算
- SQL Server 2008技术内幕:T-SQL语言基础 笔记
- SQL Server 2008技术内幕:T-SQL语言基础 笔记
- sql server 2008语言基础: T-sql语言基础2简单技巧
- sql server 2008语言基础: 再回首之Sql 2008的merge关键字
- sql server 2008语言基础: 透视转换
- sql server 2008语言基础: 透视转换
- sql server 2008语言基础: 子查询习题
- sql server 2008语言基础: 表表达式
- SQL Server 2008技术内幕:T-SQL语言基础 笔记(转)
- sql server 2008语言基础: 连接查询习题
- sql server 2008语言基础: output表达式
- Visual C# 2008+SQL Server 2005 数据库与网络开发――第2章 C#语言基础
- 笔记-Microsoft SQL Server 2008技术内幕:T-SQL语言基础-03 联接查询
- SQL Server 2008基础教程 第七章 操纵数据
- java语言基础(68)——集合框架(泛型概述和使用)
- SQL server 语言基础
- SQL Server 2008 对 T-SQL 语言的增强
- SQL Server 2008中文版关系数据库基础与实践教程pdf
- SQL Server 2008 的 Transact-SQL 语言增强