+ Start a Discussion
sai manojsai manoj 

Developer Beginner==>Apex Basics & Database Write SOQL Queries

mukesh guptamukesh gupta
Hi Manoj,

Please gow through https://trailhead.salesforce.com/en/modules/apex_database

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
SandhyaSandhya (Salesforce Developers) 
Hi,

Below is the code which worked for me.
 
public class ContactSearch {

    public static List<Contact> searchForContacts(String lastName,String postalCode){
        return [select LastName,MailingPostalCode from Contact
                where LastName = :lastName and MailingPostalCode = :postalCode order by LastName,MailingPostalCode desc];
    }
}

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya