Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- v.*,
- vo.company_name vehicle_owner_name,
- vo.vehicle_owner_id,
- vovc.name category_name,
- vovc.graphical_symbol,
- ru.remote_unit_type_id,
- ru.serial_number,
- ru.msisdn,
- ru.imei,
- ru.lm_comment rucomment,
- ru.msisdn_data,
- ru.sim_nr,
- ru.software_version,
- ru.remote_unit_type_name,
- vd.gps_full_date,
- p.first_name
- || ' '
- || p.last_name default_driver_name
- FROM
- vehicle v,
- vo_vehicle_category vovc,
- vehicle_owner vo,
- person p,
- vehicle_data vd,
- (
- SELECT
- ru.*,
- TRIM(rut.model
- || ' '
- || rut.version
- || ' '
- || rut.RELEASE) remote_unit_type_name
- FROM
- remote_unit ru,
- remote_unit_type rut
- WHERE
- ru.remote_unit_type_id = rut.remote_unit_type_id
- ) ru
- WHERE
- v.vo_vehicle_category_id = vovc.vo_vehicle_category_id (+)
- AND v.remote_unit_id = ru.remote_unit_id (+)
- AND v.vehicle_owner_id = vo.vehicle_owner_id
- AND v.last_vehicle_data_id = vd.vehicle_data_id (+)
- AND v.person_id = p.person_id (+)
- AND EXISTS (
- SELECT
- gu_vehicle.vehicle_id
- FROM
- gu_vehicle
- WHERE
- gui_user_id = 102737
- AND v.vehicle_id = gu_vehicle.vehicle_id
- )
- AND ( ( v.in_service_date IS NULL )
- OR ( v.in_service_date < SYSDATE ) )
- AND ( ( v.out_service_date IS NULL )
- OR ( v.out_service_date > SYSDATE ) )
- ORDER BY
- vo.company_name,
- vovc.name,
- v.company_nr,
- v.numberplate;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement