+ Start a Discussion
andyaldis1.3969086903835708E12andyaldis1.3969086903835708E12 

How do I query a set

I need to query a set of records but every time I try I get an error message "Illegal assignment from List to Set".
      {Public <Team_Contact__c>   contacts = [Select Contact__c, Contact__r.Name, Contact__r.Account.Name, Contact__r.Branch_Id__c, Contact__r.MailingAddress, Contact__r.Type__c, Contact__r.Focus_List_Member__c  from  Team_Contact__c where Team__c = :primaryTeam  or  Team__c = :team2 or Team__c = :team3 or Team__c = :team4 or Team__c = :team5 ];
SVsfdcSVsfdc
Try something like 
Set<Contact> acc = new Set<Contact>([SELECT id from Contact]);
andyaldis1.3969086903835708E12andyaldis1.3969086903835708E12
But will that pull in the other fields?  I need to query all the fields in the query above.