'MIN() function gives weird output in Mysql
I have a task to to find the newest and oldest model of a car in a data set(excel) and using MAX value it gives an answer.
SELECT car_name, car_year FROM car_specs WHERE car_year = (select MAX(car_year) FROM car_specs) LIMIT 1;
However when I use the same code with MIN function instead of MAX, it gives weird answer:
I've tried to but second condition but it doesn't to anything.
SELECT car_name, car_year FROM car_specs WHERE car_year = (select MIN(car_year) AND car_year >=2 FROM car_specs) LIMIT 1;
Is there any problem with the code or is it Excel's fault? The desired result is a car name and it's year(least in the sheet)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

