lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
***BOGO*** Complex conditional statement during select
- Date: Thu, 28 Aug 2008 08:43:15 -0500
- From: "Jay Blanchard" <jblanchard@xxxxxxxxxx>
- Subject: ***BOGO*** Complex conditional statement during select
SELECT this, that, theOther,
SUM(IF(SUBSTRING(myDate,1,10) >= '20080101' AND SUBSTRING(myDate,1,10)
<= '20080131'), 1, 0) AS `January`
FROM theTable
GROUP BY theOther
Throws this error...
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ')), 1, 0) AS `January`
Can I even do something like this during the SELECT. I tried a BETWEEN
and while it did not throw errors it did not give back the expected
data...I just got 0
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=royale@xxxxxxxxxx