Greater than or equal to ALL() and equal to MAX() speed

后端 未结 4 1490
春和景丽
春和景丽 2021-01-16 03:08

I have a relation in PostgreSQL named product which contains 2 fields: id and quantity, and I want to find the id of the

4条回答
  •  甜味超标
    2021-01-16 03:28

    Your queries are NOT equivalent. The first returns no rows at all if any of the quantity values are NULL. The second ignores NULL values.

    Here is a db<>fiddle illustrating this.

提交回复
热议问题