Hi!
I have a table "uudised":
NewsID int(11) PRI auto_increment
Pealkiri varchar(250)YES
Uudis text YES
Date datetime YES MUL
EditorID int(11) YES
KategID int(11) YES MUL
Autor varchar(50) YES
AllikasID int(11) YES MUL
Netis tinyint(4) YES
stmp varchar(20) YES MUL
Now I need to perform a query:
select Newsid, Pealkiri, Date from uudised where
month(Date) =11 and year(Date)=2000 order by newsid desc limit 10;
If I check query with describe function, I see that no Date index is used.
All records are scanned :( I know I have to use Date field without a month
or year function to get it properly work.
So how to rewrite this query to get Date index work?
Thanks!
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php