SQL查找最旧的车库存

时间:2014-04-10 17:45:14

标签: mysql sql

好的,我有以下表格和字段:

cars(carReg,regYear,Model,Manufacturer)
manufacturers (manufacturerId, Name, Country, Contat)

我如何获得一个Select语句,以便从“福特”作为制造商查找库存最旧的汽车?

1 个答案:

答案 0 :(得分:0)

select cars.*
from cars
join manufacturers on manufacturers.manufacturerId = cars.manufacturer
where manufacturers.Name = 'Ford'
order by cars.regYear asc
limit 1