+ 1

Help SQL practice 9.2 Brand new car

How do you sort company name by order? SELECT company, year FROM cars WHERE year = 2020; This is my coding for that practice question, but I’m not able to sort the company name by order.

22nd Sep 2021, 9:57 AM
Adam Ali
8 Respostas
+ 2
ORDER by company;
22nd Sep 2021, 10:04 AM
Simba
Simba - avatar
+ 2
I mean SELECT company, year FROM cars WHERE year = 2020 ORDER by company;
22nd Sep 2021, 10:23 AM
Simba
Simba - avatar
+ 2
Thanks guys i tried both of your coding and it works
22nd Sep 2021, 10:27 AM
Adam Ali
+ 1
SELECT company, year FROM cars WHERE year = 2020 ORDER BY company ASC; Try again this. It must be work. Adam Ali
22nd Sep 2021, 10:25 AM
mesarthim
mesarthim - avatar
+ 1
Hi
22nd Sep 2021, 10:44 PM
Sijad
Sijad - avatar
0
Add this line, ORDER BY company ASC; to order the company names by ascend. I hope, it helps. Happy coding!
22nd Sep 2021, 10:06 AM
mesarthim
mesarthim - avatar
0
I tried both of your code - SELECT company, year FROM cars ORDER BY company WHERE year = 2020; And ORDER BY company ASC It still doesnt work.
22nd Sep 2021, 10:20 AM
Adam Ali
0
SELECT COMPANY,YEAR FROM CARS WHERE YEAR = 2020 ORDER BY COMPANY;
5th Oct 2021, 1:11 PM
Fatemeh Afsahhosseini
Fatemeh Afsahhosseini - avatar