Advertisement
psi_mmobile

Untitled

Mar 23rd, 2021
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. select parentwbs.ref_number,parentwbs.name,p_poi.getPoiName(childwbs.poi_id) from wbs childwbs, wbs parentwbs
  2. where childwbs.wbs_status_id = 0
  3. 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
  4. where oc_poi_category_id = 101901
  5. and oc_poi_status_id = 0
  6. group by name, location || ' ' || post_code || ' ' || street || ' ' || country || ' ' || street_nr
  7. having count(*) > 1) dup_records
  8. where location || ' ' || post_code || ' ' || street || ' ' || country || ' ' || street_nr = dup_records.ADDRESS
  9. and op.name = dup_records.name
  10. and op.oc_poi_status_id = 0)
  11. and childwbs.parent_wbs_id = parentwbs.wbs_id(+)
  12. order by 2,3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement