我有一张桌子,上面满是物品和所说物品的价格。我想获取3个最高价商品的总和。
我想也许可以,SELECT SUM(items.price) FROM items ORDER BY items.price LIMIT 3但这似乎并不能解决问题。这可能吗?谢谢!
SELECT SUM(items.price) FROM items ORDER BY items.price LIMIT 3
select sum(price) from (select items.price from items order by items.price desc limit 3) as subt;