You need to sign in to do that
Don't have an account?
SOQL logic anomalies?
I've created a custom object “test1__c” in SF and a corresponding table “test1” in Oracle. Each has a single field “Name” and I’ve populated each with the same list:
Fred
Rose
Eugene
Liz
Andy
Inez
Siddartha
Avi
Jaime
Now I want a query that returns the names that don’t contain either an “a” or an “i” (case-insensitive). I’m using Sforce Explorer to run the SF queries.
So in Oracle:
select name from test1 where not (lower(name) like '%a%')
and not (lower(name) like '%i%')
Results:
Fred
Rose
Eugene
Alternatively, in Oracle:
select name from test1 where not (lower(name) like '%a%'
or lower(name) like '%i%')
Results:
Fred
Rose
Eugene
However, in SOQL I seemingly get different results:
select name from test1__c where (not(Name like '%a%'))
and (not(Name like '%i%'))
Results:
Fred
Rose
Eugene
Inez
Liz
Andy
Or with the equivalent logic:
select name from test1__c where not(Name like '%a%' or Name like '%i%')
Results:
Fred
Rose
Eugene
Inez
Liz
Andy
How do I log a case? I have Developer Edition.
Mike