List:General Discussion« Previous MessageNext Message »
From:Fred Lindberg Date:June 1 1999 8:50pm
Subject:RE: Inclusive/Exclusive confusion for BETWEEN operator
View as plain text  
On Mon, 31 May 1999 13:23:30 -0700, Jeff Magnusson wrote:

>select date_format(submission,'%Y-%m-%d') as df,count(*) from addresses
>group by df having df between '1999-05-01' and '1999-05-31'

This is expensive. It's probably cheaper to make the field a DATE (or
to have one of each):

select submission_date, count(*) from addressses
	where submission_date between '1999-05-01' and '1999-05-31'
	group by submission_date


-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)


Thread
Inclusive/Exclusive confusion for BETWEEN operatorJeff Magnusson1 Jun
  • Re: Inclusive/Exclusive confusion for BETWEEN operatorVivek Khera1 Jun
    • Re: Inclusive/Exclusive confusion for BETWEEN operatorunknown2 Jun
      • Re: Inclusive/Exclusive confusion for BETWEEN operatorChristian Mack2 Jun
    • RE: Inclusive/Exclusive confusion for BETWEEN operatorJeff Magnusson2 Jun
RE: Inclusive/Exclusive confusion for BETWEEN operatorFred Lindberg2 Jun