OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: question about natural join

dougsafeport.com
Date: Wed Jan 21 2009 - 08:53:47 CST


Thank you.

On Wed, 21 Jan 2009, ceol-i-e.com wrote:

>
> The natural join will JOIN on *all* the fields whose names match, not just the ones you want it to.
>
> In particular, the JOIN is matching up .expires and .expires with "="
>
> You then use WHERE to get only the ones with ">"
>
> This is a tautology: There are NO records both "=" and ">" on the field .expires.
>
> You don't really want a natural JOIN here.
>
> And, honestly, natural JOIN generally ends up being problematic sooner or later. You end up adding some kind of field to both tables that should not be included (last_update, e.g.) and suddenly your query isn't right any more.
>
> Stick with the explicit WHERE clauses that make it crystal clear what your query does.
>
> Just as SELECT * is "bad"
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=dougsafeport.com
>

_____
Douglas Denault
http://www.safeport.com
dougsafeport.com
Voice: 301-217-9220
   Fax: 301-217-9277

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql