You need to sign in to do that
Don't have an account?
simon chao
Is it possible to filter query items so that I only obtain the field with the highest number?
Is is possible to filter out a query list so I only get the highest one? For example, I would like to query a students name and his exam mark. And I only want to grab the student with the highest exam mark. (student__c is a child of class__c)
Select (Select Student_Name__c, Exam_Mark__c from Student__r ORDER BY Exam_Mark__c ASC) from class__cThis grabs all the students and it doesn't sort out the exam marks from highest to lowest. I know I can add a limit 1 to grab only the top value, but how can I gaurantee that the first query value that I am grabbing is the highest?
Did you try using the below query?
Hope this helps.
didnt understand what you said.
There may be more than one classes in the query result but student always be one due to limit.
Are you saying that you are getting more than one student(child) for a class(parent) for the parent to child query suggested above despite having limit 1 in student(child)?