|< 1 2 >| | 12 Einträge, 2 Seiten |
ALTER TABLE users ADD status ENUM('1', '2', '3') default '1' NOT NULL
QuoteIf an ENUM column is declared to allow NULL, the NULL value is a legal value for the column, and the default value is NULL. If an ENUM column is declared NOT NULL, its default value is the first element of the list of allowed values.
UPDATE users SET status = '' WHERE...
INSERT INTO testtable(feld2) values(1234);
insert into testtable values('4', 123);
1
2
3
4
create table testtable(
feld1 enum('1','2','3') default '1' not null,
feld2 integer
);
QuoteIf you insert an invalid value into an ENUM (that is, a string not present in the list of allowed values), the empty string is inserted instead as a special error value. This string can be distinguished from a &ânormal&â empty string by the fact that this string has the numerical value 0. More about this later.
|< 1 2 >| | 12 Einträge, 2 Seiten |