本文介绍了如何在sql中忽略大小写来比较字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Oracle中编写查询而忽略要比较的字符串的大小写?例如,"angel","Angel","ANGEL","angel","AngEl"在比较时都相等.
How do I write a query in Oracle ignoring the case of the strings being compared? For example "angel", "Angel", "ANGEL", "angel", "AngEl" would all be equal when compared.
推荐答案
如果要匹配字段的完整值,请使用
If you are matching the full value of the field use
WHERE UPPER(fieldName) = 'ANGEL'
从您要使用的评论中:
SELECT
RPAD(a.name, 10,'=') "Nombre del Cliente"
, RPAD(b.name, 12,'*') "Nombre del Consumidor"
FROM
s_customer a,
s_region b
WHERE
a.region_id = b.id
AND UPPER(a.name) LIKE '%SPORT%'
这篇关于如何在sql中忽略大小写来比较字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!