|
-
April 21st, 2003, 05:29 AM
#1
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?
-
April 21st, 2003, 11:36 AM
#2
Not really possible ... You can either of the sets with a Left or Right Outer Join ...
-
April 22nd, 2003, 04:16 AM
#3
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.
-
May 8th, 2003, 05:06 AM
#4
Another join term for this is called CROSS JOIN
SELECT * FROM T1 CROSS JOIN T2
Busy 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|