MySQL Forums
Forum List  »  InnoDB

Re: A trouble with aliases in JOIN statement.
Posted by: Ruslan Osmanov
Date: January 02, 2009 04:01AM

Ruslan Osmanov Wrote:
> My buggy query is:
> SELECT `rh_forum_message`.`user_id` ,
> `username` , `forum_id` , `message_id` ,
> `parent_message_id` , `subject` , `message_text` ,
> `avatar_image` , `file_size` , UNIX_TIMESTAMP(
> `message_date` ) AS `message_date`
> FROM `rh_forum_message` AS M
> JOIN `rh_user` AS U ON M.`user_id` =
> U.`user_id`
> WHERE `message_id` =1
> OR `parent_message_id` =1
> ORDER BY `message_date` ASC
>
Ouch! Such a fool question! I've just found the bug:
I simply forgot replace
SELECT `rh_forum_message`.`user_id`
by SELECT M.`user_id` , ;-)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: A trouble with aliases in JOIN statement.
3256
January 02, 2009 04:01AM


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.