Contents
Can a soql query be ordered by createddate?
This may seem like a simple question but one I thought I’d ask to confirm all the same. – if 2 records are inserted to an object within the same second, if ordering the results of a SOQL query by createddate will Salesforce return the correct order in which they were inserted (if miliseconds can be the differentiator).
When to use last _ n _ days in soql?
The LAST_N_DAYS or TODAY date literals may be useful. Otherwise you can use a specific calculated UTC Date time value. There was a recent blog post on the performance implications of LastModifiedDate vs SystemModStamp – Force.com SOQL Performance Tips: LastModifiedDate vs SystemModStamp
How does the sort order work in soql?
The sort order depends on your user locale setting. For English locales, SOQL uses the UTF-8 values of the uppercase character to create a sort order. In other words, sorting for English locales is case insensitive. For non-English locales, SOQL uses a pre-defined order that is natural for the locale specified.
How to query data that has been modified in last 24 hours?
PS : I am using the QUERY rest URI for query the data. You can use the existing LastModifiedDate or SystemModStamp fields in your SOQL query (See System Fields ). The LAST_N_DAYS or TODAY date literals may be useful.
How to create group by parent in soql?
Does not include custom fields, only standard Number fields with SOAP type int, like Account.NumberOfEmployees. Direct cross-object references to groupable fields, up to 5 levels from the root object (SOQL limit), as in SELECT count (Id) FROM Contact GROUP BY Account.Parent.Parent.Parent.Parent.Name.
How is group by having clause used in soql?
Aggregated functions for GROUP BY clause: GROUP BY HAVING Clause is used in SOQL to apply a condition based on a group field values. GROUP BY ROLLUP Clause is used to add subtotals to get aggregates data in the query results. It returns multiple levels of subtotal rows.
Are there any non groupable fields in soql?
Following are the list of Groupable & Non-Groupable field types: Number (Int). Does not include custom fields, only standard Number fields with SOAP type int, like Account.NumberOfEmployees.