Jens Vonderheide wrote:
> 
> >   Message   From   To
> >
> >   Exampel      1       2
> >
> > UserID UserName
> >    1         Me
> >    2         You
> >
> > Message   From   To
> > Exampel    Me     You
> 
> SELECT
>   u.Message, u1.UserName AS From, u2.UserName AS To
> FROM
>   Messages AS m,
>   Users    AS u1,
>   Users    AS u2
> WHERE
>   m.From = u1.UserID AND
>   m.To   = u2.UserID

Does left join (as I posted) work quicker/more efficient than this,
which has more rows (rows of m * rows of u1 * rows of u2) after join
before where/on?


> 
> Using aliases, you can reference the same table multiple times.
> 
> Jens
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to