当前位置:网站首页>Doubts about judging the tinyint field type of MySQL
Doubts about judging the tinyint field type of MySQL
2022-06-25 04:23:00 【CSDN Q & A】
In writing today SQL The sentence is ,where A... Is used in the condition tinyint Type field to judge , I didn't pay attention to the wrong judgment value , It's amazing that we can find the data
Here is the table and the corresponding SQL sentence
CREATE TABLE `test` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id', `type` tinyint(4) NOT NULL COMMENT ' type ', `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT ' name ', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;INSERT INTO `test`(`id`, `type`, `name`) VALUES (1, 0, ' name 0');INSERT INTO `test`(`id`, `type`, `name`) VALUES (2, 1, ' name 1');INSERT INTO `test`(`id`, `type`, `name`) VALUES (3, 2, ' name 2');INSERT INTO `test`(`id`, `type`, `name`) VALUES (4, 0, ' name 4');
Perform the following two SQL sentence , The result is the same
select * from test where type = 'type ';select * from test where type = 0;
id | type | name |
---|---|---|
1 | 0 | name 0 |
4 | 0 | name 4 |
I found a similar problem on the Internet , May I have your advice , What's the reason for this ?
边栏推荐
- 长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得
- 1. first knowledge of chromatic harmonica
- Uniapp makes mobile app programs, using uni Choosevideo record video, video playback is fuzzy, and the resolution is low
- 讲座记录《惯性导航的新应用——惯性测量》
- Laravel document sorting 4. Controller
- 【LeetCode】22. bracket-generating
- Laravel document sorting 7. View
- Development of trading system (III) - risk control system
- Finereport displays and hides column data according to conditions
- "Renaissance" in the digital age? The bottom digital collection makes people happy and sad
猜你喜欢
2022-06-21-flink-49 (I. SQL manual)
Development of trading system (II) -- market data
How to install opencv? Opencv download installation tutorial
Cesium 拖拽3D模型
WMS仓储管理系统的使用价值,你知道多少
DAP data scheduling function improvement description
How to quickly deliver high-value software
讲座记录《惯性导航的新应用——惯性测量》
PHP code audit 1 - php Ini
地方/園區產業規劃之 “ 如何進行產業定比特 ”
随机推荐
Laravel document sorting 3. CSRF protection
Vigilance against over range collection of privacy - ten mobile app violations
Upgrade cmake
"Grammar sugar" -- my new programming knowledge
【LeetCode】22. bracket-generating
web3.eth. Getpendingtransactions() returns null?
Cesium 拖拽3D模型
What is the difference between learning code, rolling code and fixed code? The number of repeated codes, coding capacity and the principle of rolling code
(ultra detailed onenet TCP protocol access) arduino+esp8266-01s accesses the Internet of things platform, uploads real-time collected data /tcp transparent transmission (and how to obtain and write Lu
智慧风电:数字孪生 3D 风机智能设备运维
《悉达多》:一生之书,可以时常反刍
Watch out for the stolen face! So many risks of face recognition used every day?
【LeetCode】143. Rearrange linked list
WMS仓储管理系统的使用价值,你知道多少
How to install opencv? Opencv download installation tutorial
UCLA | 用于黑盒优化的生成式预训练
文本关键词提取:ansj
Flutter FittedBox组件
AI quantitative transaction (II) -- tushare financial data framework
Hot and cold, sweet and sour, want to achieve success? Dengkang oral, the parent company of lengsuanling, intends to be listed on the main board of Shenzhen Stock Exchange