Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Date: Wed Jan 21 2009 - 08:50:37 CST
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