HAVING

作者: xueyueshuai | 来源:发表于2023-11-29 12:32 被阅读0次

    @ 你想要筛选出订单数量大于等于3的客户,可以这样写:

    SELECT customer_id, COUNT(*) AS order_count
    FROM orders
    GROUP BY customer_id
    HAVING order_count >= 3;
    

    相关文章

      网友评论

          本文标题:HAVING

          本文链接:https://www.haomeiwen.com/subject/ythfgdtx.html