function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnastasiyaAAAnastasiyaAA 

Write SOQL Queries, Error of Duplication

Hi guys,
I'm having the error below and cannot move forward in Trailhead. 
Can someone help me to find out what is the issue?

User-added image

Thank you,
Anastasiya 
Pramodh KumarPramodh Kumar
Share your code.
Take a look at my code.
public class ContactSearch {
    
    public static list<contact> searchForContacts(string first, string postal){
        list<contact> c = new list<contact>([select id, name from contact where lastname =: first and mailingpostalCode=:postal]);
        return c;
    }

}

let me know if you have any further questions


Thanks
Pramodh
AnastasiyaAAAnastasiyaAA
Hi @Pramodh,
I'm receiving the same error.