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
suresh p 149suresh p 149 

Can we write group by clause in SOSL?

Best Answer chosen by suresh p 149
SwethaSwetha (Salesforce Developers) 
HI Suresh,
We can not use Group By in SOSL. When you try Group by, it would return an error as  "Unexpected token: GROUP".

GROUP BY is not considered as a valid search token in SOSL.There is no salesforce documentation that confirms GROUP BY is supported with SOSL.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you