Home > database >  For help, SQL execution order, having the aggregation function based on which the virtual table
For help, SQL execution order, having the aggregation function based on which the virtual table

Time:10-02

Select * from TB having price & gt; Avg (price)

Select * from TBL where price & gt; (select avg (price) from tbl_aa)


For a great god, and what was wrong with the first sentence?

CodePudding user response:

This not standard written without a group by having

CodePudding user response:

There is no group by, so the price is not in the aggregate function is arbitrary lines of a value (don't remember that version, the previous version seems to be the first value)

CodePudding user response:

Having is based on the aggregation function, the original poster
  • Related