Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- vo.company_name,
- wc.work_code_name,
- wc.short_code,
- wcs.work_code_std_id || ' ' || wcs.description std_id_description,
- wc.order_num,
- wc.graphical_symbol,
- wc.is_active,
- wc.lm_date,
- wc.lm_name,
- wc.description,
- wcst.name work_code_std_type,
- wcsc.name work_code_std_category,
- wc.work_code_id,
- wc.vehicle_owner_id,
- wc.work_code_std_id
- from work_code wc, vehicle_owner vo, work_code_std_category wcsc, work_code_std_type wcst, work_code_std wcs, gui_users gu
- where wc.vehicle_owner_id = vo.vehicle_owner_id
- and wc.work_code_std_type_id = wcst.work_code_std_type_id(+)
- and wc.work_code_std_category_id = wcsc.work_code_std_category_id(+)
- and wc.work_code_std_id = wcs.work_code_std_id(+)
- and vo.vehicle_owner_status_id = 0
- and nvl(wc.is_active,'Y') = 'Y'
- and vo.default_operation_center_id != gu.operation_center_id
- and gu.gui_user_id = :gui_user_id
- and not exists (
- select 1
- from work_code wcex, vehicle_owner voex
- where wcex.vehicle_owner_id = voex.vehicle_owner_id
- and voex.default_operation_center_id = gu.operation_center_id
- and wcex.work_code_std_id = wc.work_code_std_id
- and wcex.work_code_std_id not in (996, 997, 998, 999)
- and nvl(wcex.is_active, 'Y') = 'Y'
- )
- order by vo.company_name, wc.order_num
Advertisement
Add Comment
Please, Sign In to add comment