You need to sign in to do that
Don't have an account?
Shilpa Goyal 9
sort the values on the basis of nested query column
Hi everyone,
I have a query with sub query and i want sorting on column of sub query.
Here is my query
List<Responsibility__c> rList=[select Name,Type__c,Description__c, (SELECT Description__c FROM Responsibility_Details__r)
from Responsibility__c where Skill_Matrix__r.Name=:role1 and Type__c!=null order by Type__c,Name];
I want the sorted values of description of sub query which is coming from responsibility_details__r .
how can i do that. if someone can help me.
thanks
Shilpa
I have a query with sub query and i want sorting on column of sub query.
Here is my query
List<Responsibility__c> rList=[select Name,Type__c,Description__c, (SELECT Description__c FROM Responsibility_Details__r)
from Responsibility__c where Skill_Matrix__r.Name=:role1 and Type__c!=null order by Type__c,Name];
I want the sorted values of description of sub query which is coming from responsibility_details__r .
how can i do that. if someone can help me.
thanks
Shilpa
Please use below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
but its giving me this error if i try to put order by clause in inner query
field 'Description__c' can not be sorted in a query call
I have tested below code my side:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh