WHERE clause problem

2004-05-03 Thread mayuran
This is my table: mysql desc testing; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | date | date | YES | | NULL| | +---+--+--+-+-+---+ Here are the values:

RE: WHERE clause problem

2004-05-03 Thread Victor Pendleton
Try using IN(Month(Now()), Month(Now()) -1) -Original Message- From: mayuran To: [EMAIL PROTECTED] Sent: 5/3/04 10:15 AM Subject: WHERE clause problem This is my table: mysql desc testing; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra

RE: WHERE clause problem

2004-05-03 Thread Matt Chatterley
(date) BETWEEN month(now() - interval 1 month) AND month(now) Cheers, Matt -Original Message- From: mayuran [mailto:[EMAIL PROTECTED] Sent: 03 May 2004 16:15 To: [EMAIL PROTECTED] Subject: WHERE clause problem This is my table: mysql desc testing

RE: WHERE clause problem

2004-05-03 Thread Mike Johnson
From: mayuran [mailto:[EMAIL PROTECTED] Here is my question: The following query returns incorrect rows and I dont understand why. mysql SELECT * FROM testing WHERE MONTH(date) = (MONTH(NOW()) OR MONTH(NOW())-1); ++ | date | ++ | 2004-01-01 |

Re: WHERE clause problem

2004-05-03 Thread Michael Stassen
mayuran wrote: This is my table: mysql desc testing; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | date | date | YES | | NULL| | +---+--+--+-+-+---+

Re: WHERE clause problem

2004-05-03 Thread Paul DuBois
At 11:15 -0400 5/3/04, mayuran wrote: This is my table: mysql desc testing; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | date | date | YES | | NULL| |

Yet a solution for the No-Indexes-Used-In-Selects-With-Or-In-Where-Clause-Problem

2001-12-13 Thread Michael Braun
Is there an solution for the behavior of mysql, described below? I'm using mysql 3.23.41 on MacOSX... The problem is, that MySQL isn't able to use indexes for OR in the WHERE clause yet and therefore the additional OR prevents optimal use of indexes. MySQL uses only one index for a select, so it

Re: Yet a solution for the No-Indexes-Used-In-Selects-With-Or-In-Where-Clause-Problem

2001-12-13 Thread Chris Withers
Michael Braun wrote: I'm using mysql 3.23.41 on MacOSX... The problem is, that MySQL isn't able to use indexes for OR in the WHERE clause yet and therefore the additional OR prevents optimal use of indexes. MySQL uses only one index for a select, so it can't use an index when there is an