You need to sign in to do that
Don't have an account?
davidjbb
SOQL + List.
Hello Community.
I have the following List.
List<jbbfc2__Fieldworker_Name__c> team = new List <jbbfc2__Fieldworker_Name__c>([Select Team__c From jbbfc2__Fieldworker_Name__c]);
I can't do Select Distinct for SOQL, so how can I remove all the duplicate Team__c. I need the values to be inserted into a List collection.
I'm not that great in coding, so go easy on me :)
Thank you,
Davidjbb
What about...
Regards
All Answers
What about...
Regards
Thank you for the quick response!
if I use
How do I iterate over the list? For example, I need to insert the a.Team, where it's not the duplicate Teams?
edit:
I think this worked
if you would like to get the values with out duplicates
create a set
code will be as follows.
set<string> st = new set<string>();
your list
for(jbbfc2_Dieldworker_Name__c jbb: team){
st.add(jbb.Team__c);
}
Here you are in the set you will have all the unique team names. you can use it in any query or some thing else.
I guess this will solve your problem. If you any question keep posting.
If this is answer to your question make this as a solution.
Its up to u.
Thank you for your help everyone!