I have a simple SQL statement like the following and I would like to nest the aggregate functions SUM and MIN:
SELECT SUM(MIN(r1.price))
FROM rounds r1, rounds r2
WHERE r1.round ='1'
AND r1.market = r2.market
AND r1.round = r2.round
AND r1.name = r2.name
GROUP BY market
Unfortunately, this doesn’t work.
Try: