SELECT COUNT(a.aircraft) as total
, a.aircraft
, b.fullname AS aircraft_name
FROM db_pireps AS a
JOIN db_aircraft AS b ON a.aircraft = b.id
WHERE pilotid = {$pilotid}
GROUP BY aircraft
ORDER BY total DESC
LIMIT 6
我有这个查询,但是我正在尝试添加b.registration AS reg
,但我的尝试似乎失败了,因为我不知道如何在该查询中放置另一个 SELECT。