MySQL Forums
Forum List  »  Newbie

Re: MYSQL query question
Posted by: Felix Geerinckx
Date: June 02, 2005 03:21AM

Joe Sweet wrote:

> SELECT ...
> FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt, phpbb_batlerecord br
> WHERE p.topic_id = 487
> AND pt.post_id = p.post_id
> AND u.user_id = p.poster_id
> AND br.user_id = p.poster_id
> ORDER BY p.post_time DESC
> LIMIT 0, 10
>
> Is there any way (outer/inner/whatever join) that the statement returns a row for every member

SELECT ...
FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt
LEFT JOIN phpbb_batlerecord br ON br.user_id = p.poster_id
WHERE p.topic_id = 487
AND pt.post_id = p.post_id
AND u.user_id = p.poster_id
ORDER BY p.post_time DESC
LIMIT 0, 10

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
June 02, 2005 03:12AM
Re: MYSQL query question
June 02, 2005 03:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.