List:General Discussion« Previous MessageNext Message »
From:Remo Tex Date:November 19 2004 9:43am
Subject:Re: efficient query for: "it's your birthday today"
View as plain text  
NB! ...WHERE doycol=312
Valid only for dates <= 28.Feb
OR Dates > 29.Feb but not in leap year(s) ;-)

 > doycol=DAYOFYEAR("2004-11-07")
 >
 > or
 >
 > doycol=312

Eric McGrane wrote:
> How about adding another column that stores the day of year for the
> birthday.  You could then index on this column and your query would be for
> 11/7 would be
> 
> doycol=DAYOFYEAR("2004-11-07")
> 
> or
> 
> doycol=312
> 
> E
> ""Jigal van Hemert"" <jigal@stripped> wrote in message
> news:006801c4cd50$ea60b2a0$2801a8c0@localdomain...
> 
>>I have date of birth stored in a DATETIME column and need to find for
> 
> which
> 
>>persons a certain date is their birthday.
>>
>>I've tried so far:
>>
>>    DATE_FORMAT (col, '%m%d') = '1107'        => 0.2001 sec
>>
>>    col LIKE '%-11-07%'        => 0.1643 sec
>>
>>    col RLIKE '-11-07'        => 0.1702 sec
>>
>>Are there faster alternatives for MySQL 4.0.21 ?
>>
>>Regards, Jigal.
>>
> 
> 
> 
Thread
efficient query for: "it's your birthday today"Jigal van Hemert18 Nov
  • Re: efficient query for: "it's your birthday today"Brent Baisley18 Nov
  • Re: efficient query for: "it's your birthday today"Rhino18 Nov
  • Re: efficient query for: "it's your birthday today"Jigal van Hemert18 Nov
    • Re: efficient query for: "it's your birthday today"Brent Baisley18 Nov
  • Re: efficient query for: "it's your birthday today"Jigal van Hemert18 Nov
  • Re: efficient query for: "it's your birthday today"Eric McGrane18 Nov
    • Re: efficient query for: "it's your birthday today"SGreen18 Nov
    • Re: efficient query for: "it's your birthday today"Remo Tex19 Nov
      • cancel <20041119094232.23509.qmail@lists.mysql.com>id19 Nov
  • Re: efficient query for: "it's your birthday today"Jigal van Hemert19 Nov
RE: efficient query for: "it's your birthday today"Eric McGrane18 Nov
Re: efficient query for: "it's your birthday today"Santino18 Nov