深入SQL高级子查询(上机).pptVIP

  • 13
  • 0
  • 约4.24千字
  • 约 19页
  • 2018-08-06 发布于江苏
  • 举报
深入SQL高级子查询(上机)

作业点评 理论作业 局部变量的声明使用declare关键字声明,赋值使用SET 和 SELECT SET一般将已知的的值赋给变量,SELECT是把查询的结果值赋给变量 BREAK从当前循环中跳出;RETURN结束执行当前代码块,RETURN后面所有的语句都不会再执行;GOTO跳转到标签指定的代码行继续执行。BREAK、RETURN、GOTO都可以从WHILE循环中跳出来 上机作业 select 产品编号,sum(case month(日期) when 1 then 数量 else 0 end) 1月, sum(case month(日期) when 2 then 数量 else 0 end) 2月, sum(case month(日期) when 3 then 数量 else 0 end) 3月, sum(case month(日期) when 4 then 数量 else 0 end) 4月, sum(case month(日期) when 5 then 数量 else 0 end) 5月, sum(case month(日期) when 6 then 数量 else 0 end) 6月, sum(case month(日期) when 7 then 数量 else 0 end) 7月, sum(case month(日期) when 8 then 数量 else

文档评论(0)

1亿VIP精品文档

相关文档