we want to have the second biggest element. We first use ANY to exclude the biggest one. Then we use all to select the biggest. However when we run this query, it shows the biggest and not the second one. Why?
SELECT *
FROM bestelling
WHERE totaalprijs > ALL
(
SELECT totaalprijs
FROM bestelling
WHERE totaalprijs < ANY
(
SELECT totaalprijs
FROM bestelling
)
)
elements in the table:
157.00
5.00
82.80
15.00
20.00
20.00