zoukankan      html  css  js  c++  java
  • sql server 2008语言基础: 集合

    --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
    本人在长沙, 有工作可以加我QQ4658276
  • 相关阅读:
    UML类图的关系
    软工视频总结
    面向对象——(1)概述
    软件工程——整体把握
    白盒测试中的逻辑覆盖
    机房收费调试问题(二)
    机房收费调试问题(一)
    如何将ER图转换成关系模式集
    机房收费之感想与收获
    【linux】U盘安装启动出现press the enter key to begin the installation process 就不动弹了
  • 原文地址:https://www.cnblogs.com/jianjialin/p/2442200.html
Copyright © 2011-2022 走看看