[thelist] table join for 4 tables

Asif Suria asifsuria at yahoo.com
Thu Nov 3 12:54:46 CST 2005


select tb1.*, tb2.* 
from table1 tb1, table2 tb2, table3 tb3, table4 tb4
where tb1.personID=tb2.personID and
tb1.shippingID=tb3.shippingID and tb1.skuID=tb4.skuID
and tb1.status=10

You can replace tb1.*, tb2.* with the exact columns
you want to select. Instead of joins like
tb1.skuID=tb4.skuID you can also use the alternate
syntax of tb1 join tb2 on "column name".

I hope this helps.

Asif
http://www.sinletter.com

--- Unsupported Browser <unsupportedbrowser at gmail.com>
wrote:

> I'm pretty decent with single tables and even double
> tables, but I have one
> query that has to join 4 tables and I am lost. here
> is the basic gist.
>  I need to look up information where table1 has a
> status of 10 and then I
> need to get the personid from table1 and pull in the
> personal information
> from table2, using the shippingid from table1 I need
> to get the address
> (about 6 fields) associated with that from table3,
> then I need to get the
> sku information from table4 using the skuid from
> table1.
> -- 
> 
> * * Please support the community that supports you. 
> * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip
> Harvester 
> and archives of thelist go to:
> http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



More information about the thelist mailing list