function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Indhurani KanagarajIndhurani Kanagaraj 

how to find unique fields in soql salesforce

I have non numeric field in an object. how to find unique value of that filed in soql quary?
Steven NsubugaSteven Nsubuga
Below is some pseudo code yoou can modify to suit your need.
list<AggregateResult> uniqueRecords = [select count(id) numUnique, non numeric field from object where non numeric field !=' ' group by non numeric field ];