From: Joerg Bruehe Date: October 1 2010 6:34pm Subject: Re: Not to show until a certain date List-Archive: http://lists.mysql.com/mysql/223212 Message-Id: <4CA6299D.6040907@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Hi! Hank wrote: > On Wed, Sep 29, 2010 at 8:33 AM, Patrice Olivier-Wilson > wrote: >> On 9/28/10 8:33 PM, Chris W wrote: >> >>> SELECT * >>> FROM announcements >>> WHERE announcements_expiredate > CURDATE() >>> AND announcements_postdate <=3D CURDATE() >>> ORDER BY announcements_expiredate ASC >=20 > Or how about something like this: >=20 > SELECT * > FROM announcements > WHERE CURDATE() between announcements_postdate and announcements_expir= edate > ORDER BY announcements_expiredate ASC The syntax is correct, but I don't think this statement will be optimized as well as the other proposal: BETWEEN is intended for "column BETWEEN const1 AND const2", whereas your statement is "const BETWEEN column1 AND column2". J=F6rg --=20 Joerg Bruehe, MySQL Build Team, joerg.bruehe@stripped ORACLE Deutschland B.V. & Co. KG, Komturstrasse 18a, D-12099 Berlin Geschaeftsfuehrer: Juergen Kunz, Marcel v.d. Molen, Alexander v.d. Ven Amtsgericht Muenchen: HRA 95603