Pintér Tibor (tibyke) wrote:
Select * from where date > _2005-01-07_ and date <
DATE_ADD(_2005-01-07_, INTERVAL 24 HOUR)
However is there a simpler way of doing it by just passing one date like
Select * from where date = _2005-01-07_
you may also go for "... WHERE year(foo)=a AND month(foo)=b AN
In article <[EMAIL PROTECTED]>,
"Pete Moran" <[EMAIL PROTECTED]> writes:
> Hi All,
> Is there a simpler way of doing a select for a given date, for instance if I
> have a datetime field called date
> And so its populated with a load of values such as
> 2005-01-07 09:00
> 2005-01-07 10:00
> 200
> Select * from where date > _2005-01-07_ and date <
> DATE_ADD(_2005-01-07_, INTERVAL 24 HOUR)
>
> However is there a simpler way of doing it by just passing one date like
>
> Select * from where date = _2005-01-07_
you may also go for "... WHERE year(foo)=a AND month(foo)=b AND
dayofmonth(f
Thanks Michael,
This way works fine anyway was just interested if there was a better way of
doing it.
Pete
-Original Message-
From: Michael Stassen [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 4:07 PM
To: Pete Moran
Cc: mysql@lists.mysql.com
Subject: Re: DateTime Select
0.01 sec)
-Original Message-
From: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 11:43 AM
To: Pete Moran
Cc: mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
I would investigate a partial index perhaps on the date only? You could
index on jus
Pete Moran wrote:
Hi All,
Is there a simpler way of doing a select for a given date, for instance if I
have a datetime field called date
And so its populated with a load of values such as
2005-01-07 09:00
2005-01-07 10:00
2005-01-07 11:00
2005-01-07 12:00
If I wanted all records which fall on 200
: Monday, 21 March 2005 11:22 AM
To: Logan, David (SST - Adelaide)
Cc: mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
Will try with the partial index,
Comparing the two without it is as follows
Using Like
mysql> explain select count(*) from trip where
Adelaide) [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 11:43 AM
To: Pete Moran
Cc: mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
I would investigate a partial index perhaps on the date only? You could
index on just the date eg.
ALTER TABLE ADD INDEX (date(10));
I don't ha
To: Logan, David (SST - Adelaide); mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
The table is indexed on the date field, doing a 'like' results in a
table
scan, is there another way similar principal but would allow the indexes
to
be used ?
-Original Message-
Fro
M
To: Pete Moran; mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
SELECT * FROM WHERE date LIKE '2005-01-07%';
David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia
+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 -
TED]
Sent: Monday, 21 March 2005 10:46 AM
To: mysql@lists.mysql.com
Subject: DateTime Select optimised
Hi All,
Is there a simpler way of doing a select for a given date, for instance
if I
have a datetime field called date
And so its populated with a load of values such as
2005-01-07 09:0
Hi All,
Is there a simpler way of doing a select for a given date, for instance if I
have a datetime field called date
And so its populated with a load of values such as
2005-01-07 09:00
2005-01-07 10:00
2005-01-07 11:00
2005-01-07 12:00
If I wanted all records which fall on 200
12 matches
Mail list logo