Guest User

Untitled

a guest
Jan 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. with GetParentAddr(fm, pid, id, lv, ls, sh, pc)
  2. as (
  3. select FormalName, ParentGuid, AOGUID, AOLEVEL, LiveStatus, ShortName, PostalCode
  4. from [ExtFias].[AddressObject]
  5. where aoguid ='{3F6AD2A6-CADB-433C-A44A-8E1C637F5515}' and LiveStatus = 1
  6.  
  7. union all
  8.  
  9. select FormalName, ParentGuid, AOGUID, AOLEVEL, LiveStatus, ShortName, PostalCode
  10. from [AddressObject]
  11. union
  12. select '', AOGUID, HouseGuid, 0, 0, '', PostalCode
  13. from [HouseObject] t
  14.  
  15. inner join GetParentAddr v on t.AOGUID = v.pid
  16.  
  17. )
  18. select * from GetParentAddr
  19. go
Add Comment
Please, Sign In to add comment