0

The WHERE Statement

Brand New Cars You are given the following table of cars with details: Write a query to output the brand and model years of the cars produced in 2020, sorted by the 'company' column. My code as below: SELECT company, year FROM cars WHERE year = '2020'; But the result that comes out say “no input”. Please help.

30th May 2021, 2:31 AM
Chin Eu
Chin Eu - avatar
6 ответов
+ 2
you miss at least the sort requirement ^^
30th May 2021, 2:39 AM
visph
visph - avatar
+ 2
Got it. Thanks visph for the hint. Need to use ORDER BY.
30th May 2021, 2:50 AM
Chin Eu
Chin Eu - avatar
0
You can try this also, SELECT company,year FROM cars WHERE year='2020' ORDER BY company ;
31st Aug 2021, 5:37 AM
M.P.Senura Nethsara Peiris
M.P.Senura Nethsara Peiris - avatar
0
SELECT company,year FROM cars WHERE year = '2020' ORDER BY company;
20th Sep 2021, 6:03 PM
Jobayrul Hasan
Jobayrul Hasan - avatar
0
SELECT * FROM cars WHERE year=2018 OR year>=2018;
2nd Oct 2021, 4:03 AM
SANA ULLAH
SANA ULLAH - avatar
0
SELECT company, year FROM cars WHERE year = '2020' ORDER BY company; I tested it Should work
29th Dec 2021, 1:39 PM
SevenPRD
SevenPRD - avatar