0 votes
1 view
in Salesforce by (11.9k points)

I want to know what all the existing values of a field are.

In SQL that would be something like:

SELECT DISTINCT foo

FROM bar

How might I do this with salesforce's SOQL?

1 Answer

0 votes
by (29.8k points)

Use Group by:

SELECT foo

FROM bar

GROUP BY foo

...