ve 3 possible
values to compare against in your field (null, empty string, and 1). If
you need three values (like: true, false, don't know) then make 3 enum
values. But, regardless of the contents of your ENUM list, I would still
make an ENUM field as "NOT NULL" and would set its
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
ossible
> values to compare against in your field (null, empty string, and 1). If
> you need three values (like: true, false, don't know) then make 3 enum
> values. But, regardless of the contents of your ENUM list, I would still
> make an ENUM field as "NOT NULL" a
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
need three values (like: true, false, don't know) then make 3 enum
values. But, regardless of the contents of your ENUM list, I would still
make an ENUM field as "NOT NULL" and would set its default value to one
of its enumerated values. That way, the field should only hold w
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;
+--+--+
D]
Subject: Re: True/False data type
Personally I use a tinyint(1) unsigned.
Scott Hamm wrote:
> What data type should I use to use True/False type when I create a table?
>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://
Personally I use a tinyint(1) unsigned.
Scott Hamm wrote:
What data type should I use to use True/False type when I create a table?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
On Thursday 04 November 2004 02:28 pm, Scott Hamm wrote:
> create table account (
> ID int auto_increment,
> Date date,
> Check_Number int(5),
> Bank_Match int enum(0,1),
> Category varchar(20) no null,
> Credit decimal(7,2),
> Debit decimal(7,2),
> Balance decimal(7,2),
> primary key (ID)
> );
It
- Original Message -
From: "Scott Hamm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 2004 3:15 PM
Subject: True/False data type
> What data type should I use to use True/False type when I create a table?
>
MySQL 4.1.x includes
[snip]
That page is ambiguous about creating a table with enum...
[/snip]
A teeny-tiny bit more digging and you would have found it...
`Good` enum('true','false') NOT NULL default 'false'
--
MySQL General Mailing List
For list archives: http://lists.mysql.com
work.
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 04, 2004 3:19 PM
To: Scott Hamm; [EMAIL PROTECTED]
Subject: RE: True/False data type
[snip]
What data type should I use to use True/False type when I create a
table?
[/snip]
ENUM http://www.mysq
[snip]
What data type should I use to use True/False type when I create a
table?
[/snip]
ENUM http://www.mysql.com/enum
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
What data type should I use to use True/False type when I create a table?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
r N for Yes/No.
Or how about "T" or "F" for True/False instead ;-)
> Regards,
> 'Gbamila
> - Original Message -
> From: "Tony Roberts" <[EMAIL PROTECTED]>
>
> > I the past I have used a Boolean data type for True/False,
&g
Use enum.
Rgds
Insane
SQLyog - The Definitive Win32 GUI for MySQL
http://www.sqlyog.com
- Original Message -
From: "Tony Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 4:56 PM
Subject: True/False
> I am new to MySQL
Use the data type BOOL which takes a 1 or 0 character or use CHAR and then
you can use Y or N for Yes/No.
Regards,
'Gbamila
- Original Message -
From: "Tony Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 12:26 PM
Subject:
You could use an integer (0 or 1) or an enum with the values 'y' or 'n'
-Original Message-
From: Tony Roberts [mailto:troberts@;momuk.com]
Sent: Friday, November 08, 2002 4:26 AM
To: [EMAIL PROTECTED]
Subject: True/False
I am new to MySQL and I am attempting a ne
I am new to MySQL and I am attempting a new project to help me learn.
I the past I have used a Boolean data type for True/False, Yes/No type data.
What data type should be used to achieve the storage of this type of data in
MySQL?
I have bought the reference manual (a good buy IMHO) but so far
23 matches
Mail list logo