MySQL #1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
Given 1 table as following
Item | Name | Price
----- ------------ --------
1 | Adidas | 310.00
2 | Nike Run | 30.00
3 | Puma | 150.00
4 | Nike Women | 20.00
5 | NB | 20.00
Would like to select records and return the sum amount. Do not sum up the 2 highest prices' record.
SELECT SUM(Price) as total_amount
FROM `test`
WHERE Item NOT IN (
SELECT Price
FROM `test`
ORDER BY Price DESC
LIMIT 2)
Expected Result:
total_amount
------------
70.00
How to use JOIN or alternative LIMIT in Subquery in this query?
Thank you.