Gibts da eigentlich sowas wie ein BOOLEAN?
Mysql
-
-
hmm ka ich benutz immer tinyint(2)
edit: hupps vertipp... ich mein tinyint(1)
-
es gitb ENUM
beispiel:
Code- CREATE TABLE `user` (
- `Host` char(60) binary NOT NULL default '',
- `User` char(16) binary NOT NULL default '',
- `Password` char(16) binary NOT NULL default '',
- `Select_priv` enum('N','Y') NOT NULL default 'N',
- `Insert_priv` enum('N','Y') NOT NULL default 'N',
- `Update_priv` enum('N','Y') NOT NULL default 'N',
- `Delete_priv` enum('N','Y') NOT NULL default 'N',
- `Create_priv` enum('N','Y') NOT NULL default 'N',
- `Drop_priv` enum('N','Y') NOT NULL default 'N',
- `Reload_priv` enum('N','Y') NOT NULL
-
http://dev.mysql.com/doc/mysql/en/Column_type_overview.html
-> 12.1.1 Overview of Numeric Types
BOOLEAN
These are synonyms for TINYINT(1). The BOOLEAN synonym was added in MySQL 4.1.0. A value of zero is considered false. Non-zero values are considered true. In the future, full boolean type handling will be introduced in accordance with standard SQL. -
Also du kannst mit ENUM (wert1, wert2, ...) eine Liste machen mit allen möglichen Einträgen
-
mySQL docu sais:
http://dev.mysql.com/doc/mysql/en/Numeric_type_overview.htmlZitat
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.
BIT
BOOL
BOOLEAN
These are synonyms for TINYINT(1). The BOOLEAN synonym was added in MySQL 4.1.0. A value of zero is considered false. Non-zero values are considered true. In the future, full boolean type handling will be introduced in accordance with standard SQL. -
Zitat
Original von Balthazzar
mySQL docu sais:
http://dev.mysql.com/doc/mysql/en/Numeric_type_overview.htmldas hab ich ja oben geschrieben?