Tuesday, 15 February 2011

SQL Inner join more than two tables -



SQL Inner join more than two tables -

i can query bring together of 2 tables on equality of foreign/primary key in next way.

$result = mysql_query("select * `table1` inner bring together `table2` on table1.primarykey=table2.table1id");

i'd extend multiple tables (all same foreign keys). trying next code not returning anything. can point out i'm doing wrong?

$result = mysql_query("select * `table1` inner bring together `table2` inner bring together table3 on table1.primarykey=table2.table1id=table3.table1id");

select * table1 inner bring together table2 on table1.primarykey=table2.table1id inner bring together table3 on table1.primarykey=table3.table1id

sql table inner-join

No comments:

Post a Comment