zoukankan      html  css  js  c++  java
  • 关于数据库的

    ---恢复内容开始---

    给出sql语句实现分组聚集操作的执行过程。

               1、先执行from语句中的表目连接。

               2where语句中的选择保留满足条件的分组。

               3group by将满足条件的语句进行聚合。

               4having语句在聚合后的分组中进行筛选。

               5order by对满足条件的分组进行排列。

               6select语句最后对表目中的属性选择性输出。

    左连接:

    select a.productNo,a.productName,sum(b.quantity)订单数量,b.price

    from product a left outer join orderDetail b on a.productprice>400 and b.productNo=a.productNo

    group by a.productNo,a.productName,b.price

    右连接:

    select a.productNo,a.productName,sum(b.quantity)订单数量,b.price

    from product a right outer join orderDetail b on a.productprice>400 and b.productNo=a.productNo

    group by a.productNo,a.productName,b.price

    ---恢复内容结束---

  • 相关阅读:
    js基础:关于Boolean() 与 if
    @@cursor_rows变量解析
    SQL Prompt
    google android sdk下载hoosts
    java环境配置
    Linux grep用法整理
    bash调试执行
    Vim常见快捷键汇总
    Linux查看磁盘块大小
    Linux Bash终端快捷键小结
  • 原文地址:https://www.cnblogs.com/msyou/p/5838193.html
Copyright © 2011-2022 走看看