TRUE and FALSE are the integers 1 and 0, respectively. ENUMs hold strings
which are assigned numbers starting with 1. That means that
WHERE enum_col = TRUE
will match rows whose enum_col has the *first* value defined in the ENUM list.
Also, every ENUM has the special error value '' in positio
I think you started with good advice then took a strange turn.
Chris Blackwell wrote:
If you want an enum to have the possible values of NULL or 1
alter table `Associate` modify `Active` enum('1');
from the mysql manual
http://dev.mysql.com/doc/mysql/en/ENUM.html
If an ENUM column is declared to a
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] writes:
> I would suggest that if you want to compare against FALSE that you make
> that one of your enumerated values. I would also make FALSE your default
> value and the field not nullable. That way you don't have 3 possible
> values to compa
ssage-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 10, 2004 10:22 AM
To: Scott Hamm; 'Mysql ' (E-mail)
Subject: RE: enum TRUE/FALSE
[snip]
mysql> select count(*) from Associate where Active=FALSE;
mysql> select count(*) from Associate where Acti
[snip]
mysql> select count(*) from Associate where Active=FALSE;
mysql> select count(*) from Associate where Active=TRUE;
[/snip]
Why don't you set enum('TRUE','FALSE')? I ask this because normally you
would query, when using NULL (all caps), WHERE Active IS NULL
I would suggest that if you want to compare against FALSE that you make
that one of your enumerated values. I would also make FALSE your default
value and the field not nullable. That way you don't have 3 possible
values to compare against in your field (null, empty string, and 1). If
you need
Hamm [mailto:[EMAIL PROTECTED]
Sent: 10 November 2004 14:25
To: 'Mysql ' (E-mail)
Subject: enum TRUE/FALSE
I'm trying to figure out how to make Active's null as FALSE and '1' as
TRUE, in enum point of view
Can anyone help me out here, trying to learn enum
#x27;null','1') | YES | | null | |
| Active | enum('null','1') | YES | | NULL | |
| Creator | varchar(8) | | || |
| NewAssociateDate | date | | | -00-00 | |
+------+-
[snip]
I'm trying to figure out how to make Active's null as FALSE and '1' as
TRUE,
in enum point of view
| Active | enum('','1') | YES | | NULL|
|
[/snip]
I have not tested this but have you tried enum('NULL', '1') ?
--
MySQL General Mailing List
For list archives: http://
I'm trying to figure out how to make Active's null as FALSE and '1' as TRUE,
in enum point of view
Can anyone help me out here, trying to learn enum's phenomenon? I'm not sure
I understood document quite clear -- as of yet :(
mysql> desc Associate;
+--+--+
10 matches
Mail list logo