Thread: join 3 table?
View Single Post
Old 12-02-2008, 04:13 PM   #2 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Code:
SELECT u.*, b.*, bc.* FROM blog_comment bc LEFT JOIN blog b ON(b.id=bc.blog_id) LEFT JOIN user u ON(u.id=b.user_id)
That will return the result just fine, although it can be optimized.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote