+ 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/)