SELECT work.vehicle_brand,
       work.vehicle_model,
       work.vehicle_plate,
#        maint.vehicle_maintenance_id,
       maint.vehicle_id,
#        maint.record_typology,
#        maint.record_sub_typology,
#        maint.record_relations,
#        maint.record_status,
#        maint.record_locked,
#        maint.record_uuid,
#        maint.record_code,
#        maint.record_list_name,

       maint.vehicle_maintenance_name  as operazione,
       maint.vehicle_maintenance_place as posizione,
#        maint.vehicle_maintenance_amount,
       maint.vehicle_maintenance_text  as info,
#        maint.file_name1,
#        maint.file_description1,
#        maint.file_name2,
#        maint.file_description2,
#        maint.file_name3,
#        maint.file_description3,
#        maint.file_name4,
#        maint.file_description4,
#        maint.record_control_code,
#        maint.record_control_fields,
       maint.vehicle_maintenance_date  as data_manutenzione,
       maint.vehicle_maintenance_name  as attivita,
       maint.vehicle_maintenance_place as luogo
       #        maint.created_by,
#        maint.updated_by,
#        maint.deleted_by,
#        maint.created_at,
#        maint.updated_at

FROM vehicle_maintenances as maint
         left join vehicles as work on maint.vehicle_id = work.vehicle_id
ORDER BY vehicle_plate,vehicle_brand asc

