ErikIvanov

Untitled

Mar 29th, 2021
902
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT rest.Id, rest.Code, filial.Name filial, reg.Name Region, rest.PriceCode, codeT.Name
  2.   , rest.IsActive, rest.BegDate, rest.EndDate, codeT.Priority*geo.Priority Priority
  3. FROM MARKET.dbo.[restrict] rest
  4.   INNER JOIN restrictGeoLevel geo ON rest.GeoLevelId = geo.Id
  5.   INNER JOIN codeType codeT ON codeT.Id = rest.CodeTypeId
  6.   LEFT JOIN cnFilial filial ON filial.Id = rest.FilialId
  7.   LEFT JOIN region reg ON reg.Id = rest.RegionId
RAW Paste Data