Re: mysql_insert_id() and JOIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
> Sorry my question... but why I must use JOIN if I can use SELECT * FROM
> table1 AND table2 AND table3 WHERE table1.id=table2.id=table3 not?
> thanks
>
> +                                                                          _
[/snip]


select table1.field1, table1.field2, table2.field3, table2.field4,
table3.field5 from
table1, table 2, table3
where table1.id=table2.id and table1.id = table3.id


vs

select table1.field1, table1.field2, table2.field3, table2.field4,
table3.field5
from
table1
inner join table2 on table1.id = table2.id
outer join table3 on table1.id = table3.id


The first statement only does INNER JOINS, the seconds allows for
INNER and OUTER joins, so its more flexible in terms of what you want
the data to be

Bastien

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux