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
  • 相关阅读:
    线性回归——梯度下降
    Python 实现 KNN(K-近邻)算法
    Python 增加博客园阅读量
    阿里云CentOS安装配置Python3.7及pip3
    OnlineJudge难度与正确度的相关性检验
    jsp、jQuery、servlet交互实现登录功能
    Java Web中提交表单之后跳转到WebContent目录下的子目录里的jsp文件
    python3爬虫——下载unsplash美图到本地
    defer原理、性能、优化
    Python生成器和迭代器
  • 原文地址:https://www.cnblogs.com/jianjialin/p/2442200.html
Copyright © 2011-2022 走看看