From:http://database.51cto.com/art/201203/323863.htmMany people on the web are consulting MySQL for Boolean types? The MySQL database does provide a Boolean type that can be written as a Boolean type bool or Boolean type Boolean, but does the MySQL
About MySQL for Boolean and tinyint (1)Boolean typeMySQL saves a Boolean value with 1 for true,0 representing False,boolean in MySQL with type tinyint (1),There are four constants in MySQL: True,false,true,false, which represent 1,0,1,0 respectively,
About MySQL for Boolean and tinyint (1)Boolean typeMySQL saves a Boolean value with 1 for true,0 representing False,boolean in MySQL with type tinyint (1),There are four constants in MySQL: True,false,true,false, which represent 1,0,1,0 respectively,
Mysql boolean booleantinyint (1) mysql official documentation pointed out that currently does not support the boolean type, use tinyint (1) instead. If you define a boolean type, it automatically converts it to tinyint. BOOL and BOOLEAN are synonyms
MySQL basics 06 data type (6) type conversion, mysql Data Type1.Cast () Usage
In MySQL, cast (value as target type) syntax can be used for conversion of most types.
Cast must be followed by left parentheses:
Mysql> select cast (123 as char );
+ ---
Boolean typeMySQL saves a Boolean value with 1 for true,0 representing False,boolean in MySQL with type tinyint (1),There are four constants in MySQL: True,false,true,false, which represent 1,0,1,0 respectively,Mysql> Select True,false,true,false;+--
Mysql boolean settings bitsCN.com
Mysql boolean settings
MySQL does not have the boolean type. This is also a strange phenomenon. Example:
Create table xs
(
Id int primary key,
Bl boolean
)
In this way, you can create a table
(i) data type test (1). Boolean type Bool/boolean and micro-integral tinyint a). To create a test table structure Root@localhost:test 05:12:49> CREATE TABLE boolean_test (ID INT not NULL auto_increment, -> Online_flag BOOL, -> Lock_flag BOOLEAN, ->
Mysql's boolean setting does not have the boolean Type in MySQL. This is also a strange phenomenon. For example, create table xs (id int primary key, bl boolean) can be created successfully, but you can check the statements after the table is
MySQL does not have a Boolean type. This is also a very strange phenomenon. Cases:Create Table xs ( intprimarykey, bl Boolean)This is a good way to create a success, but looking at the statement after the build, you will find that MySQL replaced
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.