Re: enum TRUE/FALSE

2004-11-10 Thread Michael Stassen
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

Re: enum TRUE/FALSE

2004-11-10 Thread Michael Stassen
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

Re: enum TRUE/FALSE

2004-11-10 Thread Harald Fuchs
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

RE: enum TRUE/FALSE

2004-11-10 Thread Scott Hamm
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

RE: enum TRUE/FALSE

2004-11-10 Thread Jay Blanchard
[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

Re: enum TRUE/FALSE

2004-11-10 Thread SGreen
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

RE: enum TRUE/FALSE

2004-11-10 Thread Chris Blackwell
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

RE: enum TRUE/FALSE

2004-11-10 Thread Scott Hamm
#x27;null','1') | YES | | null | | | Active | enum('null','1') | YES | | NULL | | | Creator | varchar(8) | | || | | NewAssociateDate | date | | | -00-00 | | +------+-

RE: enum TRUE/FALSE

2004-11-10 Thread Jay Blanchard
[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://

enum TRUE/FALSE

2004-11-10 Thread Scott Hamm
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; +--+--+