Vishal_Thoriya
Vishal_Thoriya

Reputation: 13

How to use Not Like comparison operator in Salesforce Database Query?

Following is example of SQL database query

SELECT * 
FROM suppliers
WHERE supplier_name not like 'T%';

This query will returns the records where supplier_name does not starts with T

But how can I achieve the same functionality in salesforce?

Upvotes: 1

Views: 3520

Answers (2)

Levementum
Levementum

Reputation: 1

You can also use something like this: SELECT 'fieldNamesNeeded' FROM suppliers WHERE supplier_name !=:'T%'

Upvotes: 0

superfell
superfell

Reputation: 19040

There's no select *, so you have to specifiy the exact fields to query, you'd then use NOT and LIKE, e.g.

SELECT id,name, otherFields from suppliers where NOT supplier_name like 'T%'

Upvotes: 5

Related Questions