Page 1 of 1

Multiple table JOIN???

Posted: Fri Feb 19, 2010 7:59 am
by alex.barylski
I am trying to LEFT JOIN multiple tables, two tables are data tables and one is a junction (association) table:

[sql]SELECTFROM    aquarius.rpi_procedure_sequences    INNER JOIN aquarius.rpi_procedures         ON (rpi_procedure_sequences.id_procedure = rpi_procedures.id_primary)    INNER JOIN aquarius.rpi_sequences         ON (rpi_procedure_sequences.id_sequence = rpi_sequences.id_primary);[/sql]

Am I missing an AND or what? I am getting an error in my MySQLYog control panel...
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM
aquarius.rpi_procedure_sequences
INNER JOIN aquarius.rpi_procedur' at line 2
Just curious...

Cheers,
Alex

Re: Multiple table JOIN???

Posted: Fri Feb 19, 2010 8:02 am
by VladSun
SELECT * ;)

Re: Multiple table JOIN???

Posted: Fri Feb 19, 2010 8:09 am
by Eran
yep, need to specify columns :)

Re: Multiple table JOIN???

Posted: Fri Feb 19, 2010 3:50 pm
by alex.barylski
Haha...ooops I can't believe I missed that. :D

Anyways, thank you, I think I finally just cliqued with JOIN's and finally get their prupose. Joining tables, duh! All this time I joined tables in the WHERE clause which is horribly inefficient. :P

Cheers,
Alex