On Wednesday 21 November 2001 03:01, James O'Brien wrote:
> I have been trying to perform a join with several tables and I am having no
> joy.

error messages would increase the understanding of exactly what joy
you aren't having ;-)

> Can some one send me a query (just a select * is fine) for these tables
> the ID's i'm using below aren't the real column names but they will do for
> the purpose of this email.
>
> select * from
> table1 left join table2 on table1.id=table2.id
> table2 left join table3 on table2.id1=table3.id2 and table2.id2=table3id2
> table3 left join table4 on table3.id3=table4.id3
> table3 left join table5 on table3.id4=table5.id4
> table3 left join table6 on table3.id5=table6.id5
> table3 left join table7 on table3.id6=table7.id6

Have you tried something like this?:

select * from
table1 left join table2 on table1.id=table2.id
       left join table3 on table2.id1=table3.id2 and table2.id2=table3id2
       left join table4 on table3.id3=table4.id3
       left join table5 on table3.id4=table5.id4
       left join table6 on table3.id5=table6.id5
       left join table7 on table3.id6=table7.id6

HTH

-- 
Ian Barwick - Developer - [EMAIL PROTECTED]
akademie.de asp GmbH - http://www.akademie.de

"To query tables in a MySQL database is more fun than eating spam"

---------------------------------------------------------------------
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