Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT gu.loginname, gu.loginpwd FROM gui_users gu, (SELECT gv.gui_user_id, COUNT(gv.vehicle_id) vehicle_count FROM gu_vehicle gv, vehicle v, vo_vehicle_category vovc
- WHERE gv.vehicle_id = v.vehicle_id
- AND v.vo_vehicle_category_id = vovc.vo_vehicle_category_id
- AND NVL(vovc.is_active,'Y') = 'Y'
- AND vovc.is_object = 'N'
- AND NVL(v.vehicle_status_id,0) = 0
- GROUP BY gv.gui_user_id
- HAVING COUNT(gv.vehicle_id) > 25) nv
- WHERE gu.gui_user_id = nv.gui_user_id
- AND LOWER(gu.loginpwd) NOT LIKE '%deleted%';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement