【问题标题】:find records with lower case names and upper first letter names [duplicate]查找具有小写名称和大写首字母名称的记录[重复]
【发布时间】:2019-07-01 18:42:32
【问题描述】:

我有一个 oracle 数据库,在我的表中,一些记录名称都是小写的,有些记录的第一个字母是大写的。例如:洛根和洛根。我需要能够返回两个结果。

这是我的查询

SELECT DISTINCT uzer.email, uzer.firstname, uzer.lastname,  account.name, 
account.brand,account.id
FROM UZER, ACCOUNT, UZERACCOUNT
where UZER.ID=UZERACCOUNT.UZERID AND ACCOUNT.ID=UZERACCOUNT.ACCOUNTID
AND UZER.firstname='Logan' 

有没有一种方法可以做到这一点而无需添加 OR?因为这个查询也将增长到使用姓氏,我需要它快速

【问题讨论】:

    标签: sql oracle


    【解决方案1】:

    尝试使用 UPPER():

    SELECT DISTINCT uzer.email, uzer.firstname, uzer.lastname,  account.name, 
    account.brand,account.id
    FROM UZER, ACCOUNT, UZERACCOUNT
    where UZER.ID=UZERACCOUNT.UZERID AND ACCOUNT.ID=UZERACCOUNT.ACCOUNTID
    AND upper(UZER.firstname)=upper('Logan' )
    

    【讨论】:

    • 这很好用。谢谢!
    猜你喜欢
    • 2017-04-21
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 2022-06-30
    • 2016-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多