0

我有一个 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?因为这个查询也将增长到使用姓氏,我需要它快速

4

1 回答 1

0

尝试使用 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' )
于 2019-02-07T15:38:37.763 回答