• 请不要在回答技术问题时复制粘贴 AI 生成的内容
liunaijie
V2EX  ›  程序员

Mysql Group by 问题请教

  •  
  •   liunaijie · Sep 13, 2019 · 3736 views
    This topic created in 2626 days ago, the information mentioned may be changed or developed.

    对 mysql 中的 group by 执行流程不太了解,如果同时使用 where group by having 语句后他们的执行顺序是怎样的,画了一个流程图不知道对不对,请大家指教一下。

    2 replies  •  2019-09-13 10:18:37 +08:00
    intermole
    intermole
    Sep 13, 2019 via iPhone
    1
    先 where,然后再
    在 where 结果里 group by,然后在 group by 结果里 having
    yiyang1106
    yiyang1106
    Sep 13, 2019❤️2
    2
    where---->group by----->having where 是在分组前对数据进行过滤(即操作原始数据),而 having 是对分组后的数据进行过滤
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1960 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 08:50 · PVG 16:50 · LAX 00:50 · JFK 03:50
    ♥ Do have faith in what you're doing.