Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT wbs.wbs_id
- || wbs.poi_id AS wbsWbsIdWbsPoiId,
- wbs.wbs_id,
- wbs.poi_tin,
- '['
- || wbs.poi_tin
- || ']' AS display_poi_tin,
- VGuiUserOcPoi.name AS poi_name,
- P_WBS.getWbsName(Wbs.WBS_ID, VGuiUserOcPoi.POI_ID) AS wbs_name,
- wbs.ref_number
- FROM V_GUI_USER_OC_POI VGuiUserOcPoi,
- WBS Wbs
- LEFT JOIN WBS Wbs2
- ON Wbs2.POI_ID = Wbs.POI_ID
- AND Wbs2.POI_ID IS NULL
- AND ((Wbs2.WBS_LEVEL = 1
- AND Wbs.WBS_LEVEL = 0)
- OR Wbs.WBS_LEVEL = 1
- OR Wbs.WBS_LEVEL IS NULL)
- WHERE VGuiUserOcPoi.POI_ID = Wbs.POI_ID
- AND VGuiUserOcPoi.GUI_USER_ID = 102888
- AND wbs.wbs_id IS NOT NULL
- AND wbs.poi_tin IS NOT NULL
- AND VGuiUserOcPoi.oc_poi_status_id = 0
- ORDER BY wbs_name,
- poi_tin;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement