CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30
CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
insert into animals values(null,'kitty'),(null,'KITTY'),(null,'hello');
#没用binary
select id from animals where name like '%it%';
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0.00 sec)
#用到binary
select id from animals where name like binary '%it%';
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.03 sec)
--结束END--
本文标题: binary在select中用来区分大小写
本文链接: https://lsjlt.com/news/35292.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0