当前位置:网站首页>mysql的tinyint字段类型判断的疑惑
mysql的tinyint字段类型判断的疑惑
2022-06-25 03:54:00 【CSDN问答】
今天在写SQL语句是,where条件中使用了一个tinyint类型的字段做判断,自己没有留意写错了判断值,神奇的是竟然能查到数据
以下是表和对应的SQL语句
CREATE TABLE `test` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id', `type` tinyint(4) NOT NULL COMMENT '类型', `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;INSERT INTO `test`(`id`, `type`, `name`) VALUES (1, 0, '名称0');INSERT INTO `test`(`id`, `type`, `name`) VALUES (2, 1, '名称1');INSERT INTO `test`(`id`, `type`, `name`) VALUES (3, 2, '名称2');INSERT INTO `test`(`id`, `type`, `name`) VALUES (4, 0, '名称4');执行下面的两条SQL语句,得到的结果竟然是一样的
select * from test where type = 'type ';select * from test where type = 0;| id | type | name |
|---|---|---|
| 1 | 0 | 名称0 |
| 4 | 0 | 名称4 |
在网上找了没有看到类似的问题,请教各位,这是什么原因呢?
边栏推荐
- JS tool function, self encapsulating a throttling function
- Cesium 加载显示热力图
- Qt编译数据库插件通用步骤说明
- Russian Airi Research Institute, etc. | SEMA: prediction of antigen B cell conformation characterization using deep transfer learning
- Hello CTP (II) -- Introduction to CTP
- How to use ide to automatically sign and debug Hongmeng application
- Intel 13代酷睿首次露出真面目:68MB缓存提升明显
- 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
- Jilin University 22 spring March document retrieval assignment assessment-00073
- Changsha's "talent seeking": "making efforts" and "making practical moves" go hand in hand, "rapid development" and "slow life" go hand in hand
猜你喜欢

"Grammar sugar" -- my new programming knowledge

警惕超范围采集隐私-移动APP违规十宗罪

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

Development of trading system (VI) -- HFT high frequency trading

Time management understood after working at home | community essay solicitation

numpy np tips:使用opencv对数组插值放缩到固定形状 cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)

Development of trading system (VIII) -- Construction of low delay network

Siddhartha: the book of life can be regurgitated frequently

Hello CTP (II) -- Introduction to CTP

1.初识半音阶口琴
随机推荐
How much do you know about the use value of WMS warehouse management system
PHP code audit 1 - php Ini
Russian Airi Research Institute, etc. | SEMA: prediction of antigen B cell conformation characterization using deep transfer learning
【LeetCode】148. Sort linked list
Acmstreamopen return value problem
[team learning] SQL programming language notes - task04
2022-06-21-flink-49 (I. SQL manual)
How to quickly deliver high-value software
长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得
地方/園區產業規劃之 “ 如何進行產業定比特 ”
2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
PHP code audit 2 - these functions must be known and understood
Cesium drag 3D model
AI quantitative transaction (II) -- tushare financial data framework
Work assessment of pharmacotherapeutics of Jilin University in March of the 22nd spring -00064
1. first knowledge of chromatic harmonica
虽然传统意义上的互联网早已不复存在,但这并不代表互联网早已消失不再
学习码 滚动码 固定码 有什么区别重码数,编码容量滚动码的原理
Text keyword extraction: ansj
How to use crawlers to capture bullet screen and comment data of station B?