Is It Possible to create a Join with Multiple Tables
am 26.09.2009 05:28:46 von cool
:Newbie:
Short Question: Is it possible to create an inner join (or another
join) with multiple tables?
something like
$query_list1 = "SELECT table1.id,table1.status, table2.id, table3.id
(more here - etc.) FROM table1
INNER JOIN table2 ON table1.id = table2.id
INNER JOIN table3 ON table2.id = table3.id
WHERE table1.status = 'open'";
Q: Is something like this possible?
Thanks,
cool@hosting4days.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Is It Possible to create a Join with Multiple Tables
am 26.09.2009 15:40:02 von Arthur Fuller
--0016e644cd969dae9c04747b333f
Content-Type: text/plain; charset=ISO-8859-1
I don't see why not, but another choice is to create a view that encompasses
all these tables and Select * From my_view.
Arthur
On Fri, Sep 25, 2009 at 11:28 PM, cool@hosting4days.com <
cool@hosting4days.com> wrote:
> :Newbie:
> Short Question: Is it possible to create an inner join (or another join)
> with multiple tables?
>
> something like
>
> $query_list1 = "SELECT table1.id,table1.status, table2.id, table3.id (more
> here - etc.) FROM table1
> INNER JOIN table2 ON table1.id = table2.id
> INNER JOIN table3 ON table2.id = table3.id
> WHERE table1.status = 'open'";
>
>
> Q: Is something like this possible?
>
>
>
> Thanks,
> cool@hosting4days.com
>
>
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=fuller.artful@gmail.com
>
>
--0016e644cd969dae9c04747b333f--
Re: Is It Possible to create a Join with Multiple Tables
am 29.09.2009 14:59:12 von Shawn Green
cool@hosting4days.com wrote:
> :Newbie:
> Short Question: Is it possible to create an inner join (or another join)
> with multiple tables?
>
> something like
>
> $query_list1 = "SELECT table1.id,table1.status, table2.id, table3.id
> (more here - etc.) FROM table1
> INNER JOIN table2 ON table1.id = table2.id
> INNER JOIN table3 ON table2.id = table3.id
> WHERE table1.status = 'open'";
>
>
> Q: Is something like this possible?
>
The easiest way to find out if something might work is to try it. Did
you actually try the statement you posted above? Assuming your typing
was correct, it should have worked just fine.
For future reference, here is the JOIN page in the MySQL manual:
http://dev.mysql.com/doc/refman/5.1/en/join.html
Suggestion -- If you have a problem: document what you did, what you did
it to, and the error message you received. Include any alternatives you
have tried and enough explanation that we can figure out what you are
trying to accomplish. Normally this will get you correct and accurate
responses very quickly.
--
Shawn Green, MySQL Senior Support Engineer
Sun Microsystems, Inc.
Office: Blountville, TN
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org