Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select parentwbs.ref_number,parentwbs.name,p_poi.getPoiName(childwbs.poi_id) from wbs childwbs, wbs parentwbs
- where childwbs.wbs_status_id = 0
- and childwbs.poi_id in (select poi_id from oc_poi op,(select name, location || ' ' || post_code || ' ' || street || ' ' || country || ' ' || street_nr ADDRESS, count(*) dups from oc_poi
- where oc_poi_category_id = 101901
- and oc_poi_status_id = 0
- group by name, location || ' ' || post_code || ' ' || street || ' ' || country || ' ' || street_nr
- having count(*) > 1) dup_records
- where location || ' ' || post_code || ' ' || street || ' ' || country || ' ' || street_nr = dup_records.ADDRESS
- and op.name = dup_records.name
- and op.oc_poi_status_id = 0)
- and childwbs.parent_wbs_id = parentwbs.wbs_id(+)
- order by 2,3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement