Jeff,

> What i want to do seems simple, but i can not for the life of me
figure out
> how to do it.
> Tables:  These tables are not related in any way.
>
> A
> --
> 1
> 2
> 3
> 4
> 5
>
> B
> --
> 1,Bob
> 3,Jack
> 7,Janet
> 8,Gary
> 9,Kelly
>
> I would like to combine tables A and B with a SELECT statement to get
this:
>
> SELECT
> ------
> 1,1,Bob
> 2,3,Jack
> 3,7,Janet
> 4,8,Gary
> 5,9,Kelly
>
> So basically i want to join two tables, but i dont have anything to
match
> on...Basically, i am trying to take a column from one table and add it
to
> another table for a SELECT statement.  I am not sure if JOIN is even
what i
> am looking for here.  To do this, i am assuming both tables have the
exact
> same number of records.
> Any ideas on how i can do this?

SQL tables are treated as sets. Establishing a relationship between two
tables requires a set operation.

Thus a join must be carried out on some relationship between the
row-contents of the tables (your term: "match"). The sole exception to
this is a "cartesian product" which joins every row in each table to
every row in the other table (not what you wanted).

There is no relationship, explicit or implied, which will sequence two
tables side-by-side (AFAIK). You could accomplish this using a
scripting/programming language to merge the table-rows having separately
read the two tables according to the defined sequence(s)!

Sorry,
=dn


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to