Если значения attr_id
всегда идентичны для make, description, gearbox
, вы можете получить требуемый результат с помощью следующего запроса:
select make.vehicle_id ,
make.attr_value as make ,
description.attr_value as description ,
gearbox.attr_value as gearbox
from
car_table make,
car_table description,
car_table gearbox
where make.vehicle_id = description.vehicle_id
and description.vehicle_id = gearbox.vehicle_id
and make.attr_id = 123
and description.attr_id = 345
and gearbox.attr_id = 678