当前位置:网站首页>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 ?
边栏推荐
- 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
- Zoran community
- 冷热酸甜、想成就成?冷酸灵母公司登康口腔欲在深交所主板上市
- Hello CTP (I) - basic knowledge of futures
- 【LeetCode】143. 重排链表
- PHP code audit 2 - these functions must be known and understood
- Intel 13代酷睿首次露出真面目:68MB缓存提升明显
- Summary of various problems encountered by cocos2d-x
- Upgrade cmake
- Serious PHP defects can lead to rce attacks on QNAP NAS devices
猜你喜欢

How to draw an industry investment map

Numpy NP tips: use OpenCV to interpolate and zoom the array to a fixed shape cv2 resize(res, dsize=(64, 64), interpolation=cv2. INTER_ CUBIC)

Coinlist queuing tutorial to improve the winning rate

Changsha's "talent seeking": "making efforts" and "making practical moves" go hand in hand, "rapid development" and "slow life" go hand in hand

Cesium graphic annotation circle, square, polygon, ellipse, etc

La gamme NFT Color, qui représente la diversité, est en ligne sur la plate - forme du marché Sandbox

《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台

地方/园区产业规划之 “ 如何进行产业定位 ”

Development of trading system (V) -- Introduction to Sinovel counter

AI quantitative transaction (II) -- tushare financial data framework
随机推荐
讲座记录《惯性导航的新应用——惯性测量》
“语法糖”——我的编程新知
Cesium drag 3D model
AI quantitative transaction (I) -- Introduction to quantitative transaction
L'épée leetcode fait référence au chemin leetcode de l'offre II 091 pour peindre la maison [planification dynamique] heroding
Flutter Builder & FutureBuilder组件
1. Phase II of the project - user registration and login
【LeetCode】22. 括号生成
How to draw an industry investment map
长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得
WMS仓储管理系统的使用价值,你知道多少
BSC smart contract dividend mainstream currency | including marketing wallet | deflation | reflow | dividend free token | available for direct deployment
Mathematical analysis_ Notes_ Chapter 3: limits
地方/園區產業規劃之 “ 如何進行產業定比特 ”
讲座记录《多种空间大地测量技术的数据处理方法和应用》
Serious PHP defects can lead to rce attacks on QNAP NAS devices
如何绘制产业招商地图
numpy np tips: numpy数组的squeeze等处理
智慧风电:数字孪生 3D 风机智能设备运维
Cesium loading display thermal diagram