Hello Roxan Sadia,
Welcome to the Microsoft Q&A forum.
From the below salesforce documentation, Bulk API 2.0 doesn’t support SOQL queries that include any of these items:
- GROUP BY, LIMIT, ORDER BY, OFFSET, or TYPEOF clauses. Don’t use ORDER BY or LIMIT, as they disable PKChunking for the query. With PKChunking disabled, the query takes longer to execute, and potentially results in query timeouts. If ORDER BY or LIMIT is used, and you experience query time outs, then remove the ORDER BY or LIMIT clause before any subsequent troubleshooting.
- Aggregate Functions such as COUNT().
- Date functions in GROUP BY clauses. (Date functions in WHERE clauses are supported.)
- Compound address fields or compound geolocation fields. (Instead, query the individual components of compound fields.)
- Parent-to-child relationship queries. (Child-to-parent relationship queries are supported.)
Whereas legacy Salesforce supports both SQL and SOQL syntax.
Workaround:
- Use Salesforce report as a workaround
- Instead, query the individual components of compound fields
I hope this answers your question.
If this answers your question, please consider accepting the answer by hitting the Accept answer and up-vote as it helps the community look for answers to similar questions..