[SOLVED] Get all possible combinatios from the values from different tables

bzavala
bzavala New Altair Community Member
edited November 2024 in Community Q&A
Hi! I need your help to solve the next problem:
I have a table with dates and a table with SKU´s

Table 1: Date-hour table
Att1                   Att2
01/03/2013        0:00
02/03/2013        1:00
02/03/2013        3:00

Table 2: Sku´s table
Att1
1
2



I need to get all possible combinatios between that tables. I want to get

Att1                   Att2        Att 3
01/03/2013        0:00        1
02/03/2013        1:00        1
02/03/2013        3:00        1
01/03/2013        0:00        2
02/03/2013        1:00        2
02/03/2013        3:00        2

How can I do that? Thanks you in advance.
Tagged:

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,

    i think cartesian product is what you search for. But be careful with many attributes.

    ~Martin
  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Many attributes is less of a problem (they are just added). Many examples is (their numbers are multiplicated).
  • bzavala
    bzavala New Altair Community Member
    Thanks you very much