-
Simple SQL
Something basic :
I have two tables tbl1 and tbl2 in a mysql database.
The first table has three records X, Y, Z
and the the second table has two records A and B
They have no common fields ( foreign keys )
With an SQL statement I'd like to generate a list of six records looking like this :
(Sequence is not important)
There is some basic function to do this which I can't recall at the moment.
I have a suspicion that it is only possible in Oracle with the sub-select
statements ( = select f1 from tblx where f2 = (select f3 from tbly) ; )
Can you help me on this?
-
Not really possible ... You can either of the sets with a Left or Right Outer Join ...
-
How Embarassing
found it,
to show a list of 6 elements from a table of 3 and a table of 2 one writes :
select * from tbl1, tbl2;
that outer/inner join stuff I'll try too.
-
Another join term for this is called CROSS JOIN
SELECT * FROM T1 CROSS JOIN T2