SQLTeam.com | Weblogs | Forums

Lets complete a catalogue...repeated N iterations


#1

Hello group,
I need help, maybe it's easy for you.. I need to repeat N iterations from N Store numbers in the second table also these stores are cluster for group of regions, so any sku could have different stores depending of the region. Also considered that If I calculated manually it's about 3 millions values. I hope help me to find a way to solve.


#2

Try this:

select a.sku
      ,b.store
      ,b.region
  from (select distinct
               sku
              ,region
          from sku_table1
       ) as a
       inner join store_target_table2 as b
               on b.region=a.region
;

Wait! Why is this in category replication?


#3

Wow!! what a simple solution just aggregate a distinct in the first select and works perfectly.Thanks
I new in the blog sorry for the category