Hello friends
Id like to thanks all friends that helped with this question
Regards
Luiz
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
luiz Rafael wrote:
SELECT * FROM `sav00_sava0400_dbf` WHERE 2000 = YEAR(`emissao`) OR
(1999 = YEAR(`emissao`) AND 12 < MONTH(`emissao`)) ORDER BY emissao ASC
Are you sure this is what you really want? MONTH() is never greater than
12, so your query is equal to:
SELECT * FROM `sav00_sav
Jay Pipes wrote:
SELECT * FROM `sav00_sava0400_dbf`
emissao BETWEEN '2000-01-01' AND '2000-12-31'
UNION ALL
SELECT * FROM `sav00_sava0400_dbf`
emissao BETWEEN '1999-12-01' AND '1999-12-31'
Why not:
SELECT * FROM `sav00_sava0400_dbf`
emissao BETWEEN '1999-12-01' AND '2000-12-31'
?? ;)
-
Hi Jay
Thanks for the help
Regards
Luiz
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
luiz Rafael wrote:
Dear friends
is their any way to optimize this query bellow, it take +- 2minutes do
complete, i think it becouse their no index by the emissao field
SELECT * FROM `sav00_sava0400_dbf` WHERE 2000 = YEAR(`emissao`) OR
(1999 = YEAR(`emissao`) AND 12 < MONTH(`emissao`)) O
Hi,
Try this...
Do an "alter" and create indexes on the following fields of your tables:
-wmkt_email_sent.fkemail
-wmkt_client.fkemail
-wmkt_maillist_client.fkclient
... and i think it's a good idea if you create indexes on the primary keys
of each table.It's redundant but have some "effect".
Reg