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
  • 相关阅读:
    HDU 4053 or ZOJ 3541 The Last Puzzle【区间dp】【经典题】
    HDU 4053 or ZOJ 3541 The Last Puzzle【区间dp】【经典题】
    Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) 831C. Jury Marks【二分】【水题】
    Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) 831C. Jury Marks【二分】【水题】
    POJ 2955 Brackets 【区间dp】【水题】
    POJ 2955 Brackets 【区间dp】【水题】
    动手动脑2
    统计创建了多少类
    动手动脑1
    动手动脑
  • 原文地址:https://www.cnblogs.com/jianjialin/p/2442200.html
Copyright © 2011-2022 走看看