我有3个容器正在运行
我只想要名字中编号最小的容器, 在这种情况下
SELECT store_locations.store_id , zip_code , city , state , last_updated , total_sales
FROM store_locations JOIN (
SELECT store_id , COUNT(c.id) AS total_sales
FROM store_locations a JOIN store_vehicles b ON a.store_id = b.store_id JOIN store_sold_vehicles c ON b.vin_number = c.vin_number
WHERE store_id = 8239
GROUP BY store_id
) totalsales ON store_locations.store_id = totalsales.store_id
任何答案都会有所帮助。 感谢。