SOQL - Salesforce Object Query Language in Apex
What is Salesforce Object Query Language (SOQL) in APEX ? SOQL means Salesforce Object Query Language which is to query the records from the database.com based on the requirement. Apex has direct access to Salesforce records that are stored in the database, you can embed SOQL queries in your Apex code and get results in a straightforward fashion. When SOQL is embedded in Apex, it is referred to as inline SOQL. To include SOQL queries within your Apex code, wrap the SOQL statement within square brackets and assign the return value to an array of sObjects. For example, the following retrieves all account records with two fields, Name and Phone, and returns an array of Account sObjects. Use SOQL when you know which objects the data resides in, and you want to: Retrieve data from a single object or from multiple objects that are related to one another. Count the number of records that meet specified criteria. Sort results as part of the query. Retrieve data from number, date, or che...