views:

285

answers:

2

Basically what I want is cross product of two tables.

t1 is :
    +------------+
    | student    |
    +------------+
    | 1234567890 | 
    | 1234567890 | 
    | 1234567890 | 
    | 000000001  | 
    +------------+
t2 is:
    +--------+
    | number |
    +--------+
    |      1 | 
    |      3 | 
    +--------+

How can I get a table which has two columns and 8 entries which are crosss product of values in t1 and t2 ?

+2  A: 

Select student, number, from t1, t2;

Steve B.
Or: `Select student, number from t1 join t2 on 1;`
Y. Shoham
+2  A: 

I think you need a CROSS JOIN.

It'll join both tables on all rows.

SELECT * FROM t1 CROSS JOIN t2
Paul Alan Taylor