I'm running into a roadblock here I have a query which is this:
That properly returns records of the highest value of the item that has multiple quantity tiers.
When I plug it in as a subquery:
It returns all records in that table. am I missing something here?
Code:
SELECT ItemCode, MAX(Quantity) AS Expr1
FROM ItemDefaultPrice
WHERE (Quantity > 1)
GROUP BY ItemCode
ORDER BY ItemCode
When I plug it in as a subquery:
Code:
SELECT CID, ItemCode, Quantity, Price, Bonus, Multiplier, AdditionalSH, VolumeTier
FROM ItemDefaultPrice
WHERE EXISTS
(SELECT ItemCode, MAX(Quantity) AS Expr1
FROM ItemDefaultPrice AS ItemDefaultPrice_1
WHERE (Quantity > 1)
GROUP BY ItemCode)
ORDER BY ItemCode