On dinsdag 2 december 2003 14:44 news told the butterflies:
> In article <[EMAIL PROTECTED]>,
> "Director General: NEFACOMP" <[EMAIL PROTECTED]> writes:
>
> > [1 <text/plain; iso-8859-1 (quoted-printable)>] Hi group,
>
> > I want to do a LEFT JOIN that takes no condition.
>
> > For example I have the following tables:
>
> > table_1 table_2
> > --------------- -----------------
> > 1 A
> > 2 B
> > 3 C
> > 4 D
> > 5 E
>
> > And I want my result to be:
>
> > table_result
> > -----------------------
> > 1 A
> > 2 B
> > 3 C
> > 4 D
> > 5 E
>
>
> > The result table has got two fields!!
> > By doing SELECT field_1, field_2 FROM table_1, table_2 I get several
> > records because it does a full join.
> > I want MySQL to just pick a record from table_1 and picks
> another one from table_2 without a specified condition.
>
> > Which type of JOIN should I use?
>
> That's not a JOIN at all. How should MySQL know which row of
> table_1 belongs to which row of table_2?
There is, however, a way to do it. You will need some sort of
scripting/programming language to do it. Example in PHP.
$Link = mysql_query('SELECT * FROM table_1');
$Result = Array();
for($i=0;$Row=mysql_fetch_row($Result);$i++) $Result[$i] = $Row;
$Link = mysql_query('SELECT * FROM table_2');
for($i=0;$Row=mysql_fetch_row($Result);$i++) $Result[$i] = $Row;
And there it is .. right in the $Result array. But tell me, what do you want
to do with it? Maybe there's a (conceptually speaking) better way to do it,
with which I'd be happy to help you ;)
Wouter
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]