Well,
T1 INNER JOIN T2
For each row R1 of T1, the joined table has a row for each row in T2 that
satisfies the join condition with R1.
T1 LEFT OUTER JOIN T2
First, an INNER JOIN is performed. Then, for each row in T1 that does not
satisfy the join condition with any row in T2, a joined row is returned with
NULL values in columns of T2. Thus, the joined table unconditionally has at
least one row for each row in T1.
and as you can see join condition is nothing to do with equality of
respective columns, which means you can state any kind of join condition
(non-equal as well as equal join)
----- Original Message -----
From: ERISEN, Mehmet Kamil <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 10:46 PM
Subject: Re: [PHP] fix my query please
> Hello Jeremy,
> Two things:
> FROM users LEFT OUTER JOIN picks using(id)
> > Where users.uid <> picks.user_id
> 1- when you do OUTER join, you do NOT have to use the <>.
> That's what outher join means.
> 2- what is id? Is it a column? shouldn't it be uid?
> Maybe that's your problem.
>
> --- Jeremy Morano <[EMAIL PROTECTED]> wrote:
> > an somebody please fix up my query.
> >
> >
> >
> >
> > $connection = @mysql_connect("l", "c", "c") or
> > die("Couldn't connect.");
> >
> > $db = @mysql_select_db($db_name, $connection) or
> > die("Couldn't select
> > database.");
> >
> >
> >
> > $sql = "SELECT distinct users.uid , users.username
> > FROM users LEFT OUTER JOIN picks using(id)
> > Where users.uid <> picks.user_id
> > ";
> >
> >
> >
> > $result = @mysql_query($sql,$connection) or die("Couldn't
> > execute query.");
> >
> >
> > while ($row = mysql_fetch_array($result)) {
> > $usersleft = $row['username'];
> > $uid = $row['uid'];
> >
> > $my_string="$usersleft<br>";
> >
> > echo $my_string;
> > }
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> =====
> Mehmet Erisen
> http://www.erisen.com
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]