Advertisement
psi_mmobile

Untitled

Feb 27th, 2020
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.90 KB | None | 0 0
  1. SELECT wbs.wbs_id
  2.   || wbs.poi_id AS wbsWbsIdWbsPoiId,
  3.   wbs.wbs_id,
  4.   wbs.poi_tin,
  5.   '['
  6.   || wbs.poi_tin
  7.   || ']'                                             AS display_poi_tin,
  8.   VGuiUserOcPoi.name                                 AS poi_name,
  9.   P_WBS.getWbsName(Wbs.WBS_ID, VGuiUserOcPoi.POI_ID) AS wbs_name,
  10.   wbs.ref_number
  11. FROM V_GUI_USER_OC_POI VGuiUserOcPoi,
  12.   WBS Wbs
  13. LEFT JOIN WBS Wbs2
  14. ON Wbs2.POI_ID                     = Wbs.POI_ID
  15. AND Wbs2.POI_ID                   IS NULL
  16. AND ((Wbs2.WBS_LEVEL               = 1
  17. AND Wbs.WBS_LEVEL                  = 0)
  18. OR Wbs.WBS_LEVEL                   = 1
  19. OR Wbs.WBS_LEVEL                  IS NULL)
  20. WHERE VGuiUserOcPoi.POI_ID         = Wbs.POI_ID
  21. AND VGuiUserOcPoi.GUI_USER_ID      = 102888
  22. AND wbs.wbs_id                    IS NOT NULL
  23. AND wbs.poi_tin                   IS NOT NULL
  24. AND VGuiUserOcPoi.oc_poi_status_id = 0
  25. ORDER BY wbs_name,
  26.   poi_tin;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement