Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT kc.person_id,kc.vehicle_owner_id,vfuc.vehicle_owner_id FROM
- (SELECT person_id FROM person p, vo_person_category vopc
- WHERE p.vo_person_category_id = vopc.vo_person_category_id
- AND vopc.vehicle_owner_id = 101380
- AND p.person_status_id = 0) mjppl,
- key_code kc, vehicle_data vd, remote_unit ru, fixed_unit fu, vo_fixed_unit_category vfuc
- WHERE mjppl.person_id = kc.person_id
- AND kc.key_string = vd.driver_identifier
- AND vd.remote_unit_id = ru.remote_unit_id
- AND ru.remote_unit_id = fu.remote_unit_id
- AND fu.vo_fixed_unit_category_id = vfuc.vo_fixed_unit_category_id;
- SELECT kc.person_id,kc.vehicle_owner_id,vfuc.vehicle_owner_id FROM
- (SELECT person_id FROM person p, vo_person_category vopc
- WHERE p.vo_person_category_id = vopc.vo_person_category_id
- AND vopc.vehicle_owner_id = 101380
- AND p.person_status_id = 0) mjppl,
- key_code kc, vehicle_data vd, remote_unit ru, fixed_unit fu, vo_fixed_unit_category vfuc
- WHERE mjppl.person_id = kc.person_id
- AND kc.key_string = vd.driver_identifier
- AND vd.remote_unit_id = ru.remote_unit_id
- AND ru.remote_unit_id = fu.remote_unit_id
- AND fu.vo_fixed_unit_category_id = vfuc.vo_fixed_unit_category_id
- AND vfuc.vehicle_owner_id <> kc.vehicle_owner_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement