I have an SQL statement that looks something like this:
SELECT DISTINCT ItemID, Brand, PriceA*1.1 AS PriceB
FROM InventoryTable
Order By PriceB
When I run the SQL above I get an error that looks something like this:
ORDER BY clause (PriceB) conflicts with DISTINCT.
I did some research on this problem and it seems like I cannot do a ORDER BY on a calculated field inside a Distinct clause. Is that correct? If so is there anyway I can work around this? I really need to get this to work and I appreciate any help I can get on this, thank you in advance for your help!
SELECT DISTINCT ItemID, Brand, PriceA*1.1 AS PriceB
FROM InventoryTable
Order By PriceB
When I run the SQL above I get an error that looks something like this:
ORDER BY clause (PriceB) conflicts with DISTINCT.
I did some research on this problem and it seems like I cannot do a ORDER BY on a calculated field inside a Distinct clause. Is that correct? If so is there anyway I can work around this? I really need to get this to work and I appreciate any help I can get on this, thank you in advance for your help!