-Original Message-
From: Christoph Boget [mailto:christoph.bo...@gmail.com]
http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.
html#function_mod
SELECT MOD( X, 2 )
where X is your number (or column name). If 0, it's even if
1 it's odd.
I think you mean, if it
where X is your number (or column name). If 0, it's even if
1 it's odd.
I think you mean, if it is non-zero, then it is odd.
If you're MODding using 2 as the second argument, it's always going to
be 0 or 1. 2 either divides in to the number evenly, having a
remainder of 0, or it'll have a
My apologies. With your example; SELECT MOD( X, 2 ), it will do exactly as you
say it will do.
-Original Message-
From: Christoph Boget [mailto:christoph.bo...@gmail.com]
Sent: Tuesday, August 31, 2010 2:26 PM
To: Coll-Barth, Michael
Cc: mysql@lists.mysql.com
Subject: Re: FW: Even