Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with GetParentAddr(fm, pid, id, lv, ls, sh, pc)
- as (
- select FormalName, ParentGuid, AOGUID, AOLEVEL, LiveStatus, ShortName, PostalCode
- from [ExtFias].[AddressObject]
- where aoguid ='{3F6AD2A6-CADB-433C-A44A-8E1C637F5515}' and LiveStatus = 1
- union all
- select FormalName, ParentGuid, AOGUID, AOLEVEL, LiveStatus, ShortName, PostalCode
- from [AddressObject]
- union
- select '', AOGUID, HouseGuid, 0, 0, '', PostalCode
- from [HouseObject] t
- inner join GetParentAddr v on t.AOGUID = v.pid
- )
- select * from GetParentAddr
- go
Add Comment
Please, Sign In to add comment