Aggregate function in SQL WHERE-Clause

前端 未结 6 578
失恋的感觉
失恋的感觉 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:52

    UPDATED query:

    select id from t where id < (select max(id) from t);
    

    It'll select all but the last row from the table t.

提交回复
热议问题