+ 2

Sql - SUBQUERY

Hey buddy. How are you? I have a quick question if you don’t mind answering. I am so confused on why this is not showing up in the order of the test. Can someone please Clear up what I am doing wrong? SELECT name,category,price,fatpercentage FROM foods WHERE fatpercentage < (SELECT AVG (fatpercentage) FROM foods) ORDER BY price,category,fatpercentage DESC;

28th Jan 2022, 6:27 PM
Tevin
6 Answers
+ 4
Tevin Just remove ORDER BY
28th Jan 2022, 6:38 PM
A͢J
A͢J - avatar
+ 2
Tevin What did you understand by remove ORDER BY means?
28th Jan 2022, 10:06 PM
A͢J
A͢J - avatar
+ 1
All you said was remove ORDER BY. Would you elaberate what you mean by removing ORDER BY?
28th Jan 2022, 10:08 PM
Tevin
+ 1
Tevin Check the task description did they say to get data in order? Did they say to use ORDER BY?
28th Jan 2022, 10:13 PM
A͢J
A͢J - avatar
+ 1
I figured it out thanks
28th Jan 2022, 10:19 PM
Tevin
0
That gave me a syntax error
28th Jan 2022, 9:44 PM
Tevin