笔记积累

来源:互联网 发布:淘宝上便宜好吃的零食 编辑:程序博客网 时间:2024/06/06 05:15
  1. except语句

  2. select CustomerID
  3. FROM #Purchase  
  4.  WHERE ProductCode IN ('A','B')  
  5.  GROUP BY CustomerID  
  6. HAVING COUNT(DISTINCT ProductCode) = 2  
  7. EXCEPT  
  8. -===== Find Customers that bought "C".  
  9. SELECT CustomerID  
  10.   FROM #Purchase  
  11.  WHERE ProductCode IN ('C')
0 0
原创粉丝点击