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
iKnowSFDCiKnowSFDC 

How do you specify a secondary sort in SOQL?

I have a list I need to sort by a primary key as well as a secondary key - I tried ORDER BY fieldName AND fieldNAME as well as ORDER BY fieldName AND BY fieldName - neither one compiled on save. 

 

Any ideas? 

 

Thanks!

 

JoAnn

Best Answer chosen by Admin (Salesforce Developers) 
craigmhcraigmh

Order By fieldName1, fieldName2

All Answers

craigmhcraigmh

Order By fieldName1, fieldName2

This was selected as the best answer
iKnowSFDCiKnowSFDC

Thanks!  I didn't find that in the documentation - who knew (besides you) that it would be so easy!  

 

JoAnn

Dark PokerDark Poker
Thanks, I was searching for this many times but here it is. nice work.
my documentation is AVG Cleaner Pro Apk (https://www.apkrare.com/avg-cleaner-pro/).
and Also For AZ Screen Recorder Premium Apk (https://www.apkrare.com/az-screen-recorder/)
Deepak Mishra 34Deepak Mishra 34
Thank You so Much for this.

Regards
MyMobileReviewer  (https://www.mymobilereviewer.com/)
Sourabh BiswasSourabh Biswas
Thank you, sir please visit also my blog TricksNext.com (https://tricksnext.com/)  
rakesh das 10rakesh das 10
Thanks, I was searching for this many times but here it is. nice work
https://www.apkspro.co/avg-cleaner-pro-apk
Inderdeep Singh 59Inderdeep Singh 59
Komal Singh 38Komal Singh 38
<a href="http://www.geturlyrics.com/teri-mitti-lyrics/">Teri Mitti Lyrics</a>