(0.05
sec)
mysql
SELECT
*
FROM
case_test
WHERE
word
COLLATE
latin1_bin
LIKE
'f%';
+---------+
|
word
|
+---------+
|
froogle
|
|
flickr
|
+---------+
2
rows
in
set
(0.00
sec)
mysql
SELECT
*
FROM
case_test
WHERE
word
LIKE
'f%'
COLLATE
latin1_bin;
+---------+
|
word
|
+---------+
|
froogle
|
|
flickr
|
+---------+
2
rows
in
set
(0.00
sec)
mysql
SELECT
*
FROM
case_test
WHERE
【mysql怎么看大写 mysql57区分大小写】word
LIKE
'F%'
COLLATE
latin1_bin;
+---------+
|
word
|
+---------+
|
Frank
|
|
FlicKr
|
+---------+
4
rows
in
set
(0.01
sec)
mysql
SELECT
*
FROM
case_test
WHERE
word
LIKE
'F%'
COLLATE
latin1_general_cs;
+---------+
|
word
|
+---------+
|
Frank
|
|
FlicKr
|
+---------+
4
rows
in
set
(0.04
sec)
Mysql怎样在SQL中实现区分大小写的查询1.问题描述
mysql版本:mariadb 10.1.16,采用utf8-ci,不区分大小写的排序规则 。
开发人员反应业务要求要区分大小写,就是说当输入小写条件时,只能返回小写条件对应的数据,不能返回大写 。
dba@192.168.19.215:3306mdls01:58:57SELECT
- cabinet_no
- FROM
- go_task_ycon_refrence gtyr
- WHERE
- 1 = 1
- AND cabinet_no = 'abcd4499503'
- ORDER BY
- 1 ASC;
+-------------+
| cabinet_no |
+-------------+
| ABCD4499503 |
+-------------+
1 row in set (0.00 sec)
2.问题解决
在条件字段后面加COLLATE utf8_bin,或在表级或字段级指定COLLATE utf8_bin
dba@192.168.19.215:3306mdls02:08:08SELECT
- cabinet_no
- FROM
- gtyr
- WHERE
- 1 = 1
- AND cabinet_no COLLATE utf8_bin = 'ABCDU4499503'
- ORDER BY
- 1 ASC;
+-------------+
| cabinet_no |
+-------------+
| ABCD4499503 |
+-------------+
1 row in set (0.00 sec)
dba@192.168.19.215:3306mdls02:08:43SELECT
- cabinet_no
- FROM
- gtyr
- WHERE
- 1 = 1
- AND cabinet_no COLLATE utf8_bin = 'abcd4499503'
- ORDER BY
- 1 ASC;
Empty set (0.00 sec)
mysql怎么看大写的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于mysql57区分大小写、mysql怎么看大写的信息别忘了在本站进行查找喔 。
推荐阅读
- sqlserver中长整数类型,sql server整数数据类型
- sqlserver数据导入到oracle,sql server数据导入
- 华为路由器信号频率怎么调,华为路由器信号调节
- 怎么在word图片里画圈,怎么在word图片里画圈圈
- 离散函数python 离散函数和连续函数
- c语言如何将字符串数组赋值给数组,字符串数组赋值
- 动作游戏联机,动作联机游戏排行榜
- 新媒体如何做女团团长,如何加入新媒体行业
- vb.net资源 vbnet implements