Aggregate function in SQL WHERE-Clause

前端 未结 6 576
失恋的感觉
失恋的感觉 2020-11-27 15:22

In a test at university there was a question; is it possible to use an aggregate function in the SQL WHERE clause.

I always thought this isn\'t possibl

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 15:47

    You can't use an aggregate directly in a WHERE clause; that's what HAVING clauses are for.

    You can use a sub-query which contains an aggregate in the WHERE clause.

提交回复
热议问题