Skip to content

SQL语句中having的执行顺序是在select之前吧 #2369

Open
@mx5518

Description

@mx5518

在SQL常见面试题总结1中,计算总和这部分的sql语句
SELECT order_num, Sum(item_price * quantity) AS total_price
FROM OrderItems
GROUP BY order_num
HAVING total_price >= 1000
ORDER BY order_num
SQL语句中having的执行顺序是在select之前吧,所以having中不能写total_price吧

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions