Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with
- locations as (select distinct LocId from T)
- items as (select distinct ItemId from T)
- select l.LocId, i.ItemId, t.SomeData
- from
- locations as l cross join items as i
- left outer join T as t
- on t.LocId = l.LocId and t.ItemId = i.ItemId;
Add Comment
Please, Sign In to add comment