I have a table SALE
with 2 columns ID
and Sales
.
I have code like this:
SELECT TOP 100 PERCENT ID, Sales
FROM SALE
WHERE ProductID = 'IDN001'
ORDER BY Sales DESC;
And the result is here:
But if I put all the code above inside the SELECT * FROM
, it shows me the original TABLE (before ordering):
SELECT *
FROM
(SELECT TOP 100 PERCENT ID, Sales
FROM SALE
WHERE ProductID = 'IDN001'
ORDER BY Sales DESC) AS NewQuery;
The new result is here:
How can I fix this?
Thank you.