>mysql ... which would prevent index usage. If your kind of query is
> frequent and slow, you could split your DATETIME column into two
> separate columns for DATE and TIME and put an index onto TIME.
Ok, thanks for the help!
Regards Emil
--
Emil Rasmussen
http://
ing about it, that i
did not like. I dont know why, it just seems a strange thing to do, when
there is a DATETIME datatype. But i might spilt them into a DATE and a TIME
field, that is definitely one solution to the problem.
Thanks!
Regards Emil
--
Emil Rasmussen
h
ed to strings, before MySQL can search the table.
MySQL have to do a complete table scan when i use the HOUR() function.
But thanks for the suggestion.
Regards Emil
--
Emil Rasmussen
http://noget.net
-
Before posting,
and days sorted by
hours.
MMDD should be some kind of a wildcard, so that i only would look at the
HHMMSS data. Now i use the HOUR() function, but then MySQL dont uses the
index.
Regards Emil
--
Emil Rasmussen
http://noget.net
---
EN AND operator does not work either. I would like to know
how to format the limits, so that MySQL understands that i want the results
from a particular hour?
Regards Emil
--
Emil Rasmussen
http://noget.net
-
Before posting, p
been very nice, because i
still have a problem with hours, eg.:
SELECT count(id)
FROM tblTable
WHERE myField != '' AND
(
myDateField >= '23' AND
myDateField < '235959'
);
Wich offcourse does not work, so again i
SQL did not
use that. But creating an index only on myDateField did the trick.
Thanks for the help!
Mvh Emil
--
Emil Rasmussen
http://noget.net
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
h
off course is, that MySQL has to do a calculation on the
myDateField before it can decide if the row matches. Any "workarounds" for
this?
Mvh Emil
--
Emil Rasmussen
http://noget.net
-
Before posting, please check:
h