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
John DaJohn Da 

Order By the 2 Sepearate Criteria In SOQL Query


I have a query as below:
Select fieldA, fieldB from object_X__c where fieldA = true and fieldB = true Order By ...

I want to return in the order such that the results that satisfies fieldA to go first, and the result that satisfies fieldB to go next. Thanks.
Pramodh KumarPramodh Kumar
Hi John Da,

The SOQL query will return you the list of records not just the cell values. Sorting the columns means it will returns the entire record based on your your field.