You need to sign in to do that
Don't have an account?
Jack A 2
How to Compare SOQL Query Result
For Example:
FYI: I know using AggregateResult is more efficient.
for(Contact con : [Select Id,Salary__c From Contact Where AccountId = :accId Limit 100]){ System.debug('Check min'+con.Salary__c); }Here I am getting all the salary from contact, now how to compare those and show minimum of them.
FYI: I know using AggregateResult is more efficient.
Let me know if that help, please mark this as best answer.
Thanks
Siddharth
OSI Consulting
All Answers
Use the aggregate functions available in SFDC and use MIN() function to get the desired result.
SELECT MIN(CreatedDate), FirstName, LastName FROM Contact GROUP BY FirstName, LastName
Let me know if you need further inputs. If this helps please mark this as best answer.
Thanks
Siddharth
OSI Consulting
Let me know if that help, please mark this as best answer.
Thanks
Siddharth
OSI Consulting