Getting Started with SOQL

Book description

Revolutionize the use of simple query strings to make them more efficient using SOQL

In Detail

This practical guide will tell you everything you need to know about SOQL statements. You will learn the optimum way to write complex SOQL statements with this easy-to-understand guide. Beginning with basic SOQL statements, you will progress quickly onto more advanced statements, such as how to filter multiselect picklist values to escape sequences.

This book will teach you how to sort records with more than one field, sorting with more than one field?one in ascending order and another field in descending order - and sorting null records in the first or in the last. You will learn about all the features provided while you are writing SOQL statements. This book will make you a SOQL expert by teaching you how to write SOQL statements in an optimized and effective way.

What You Will Learn

  • Discover how to write effective SOQL statements
  • Find out about the standards to be followed while writing SOQL statements
  • Understand the effective use of advanced SOQL statements
  • Fetch records from multiple objects
  • Sort records with multiple fields
  • Get to know about the tools that support the execution of SOQL statements and their installation guidelines
  • Understand the functional areas within SOQL queries
  • Implement mechanisms to manage SOQL on Salesforce

Table of contents

  1. Getting Started with SOQL
    1. Table of Contents
    2. Getting Started with SOQL
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Introduction to SOQL
      1. What is SOQL?
      2. Purpose of SOQL
      3. SOQL syntax
      4. Writing your first SOQL statement
      5. Summary
    9. 2. Basic SOQL Statements
      1. The alias notation
      2. The WHERE clause
      3. The comparison operators
        1. The equals operator
        2. The not equals operator
        3. The less than or equal to operator
        4. The less than operator
        5. The greater than or equal to operator
        6. The greater than operator
        7. The LIKE operator
      4. The IN operator
        1. The NOT IN operator
      5. The logical operators
        1. The AND operator
        2. The OR operator
      6. The ORDER BY clause
      7. The INCLUDES and EXCLUDES operators
      8. Summary
    10. 3. Advanced SOQL Statements
      1. Relationship queries
      2. Filtering multiselect picklist values
        1. The INCLUDES operator
        2. The EXCLUDES operator
      3. The escape sequences
      4. The date formats
      5. The date literals
      6. Querying with the date fields
      7. Sorting in both the ascending and descending orders
      8. Using the GROUP BY ROLLUP clause
      9. Using the FOR REFERENCE clause
      10. Using the FOR VIEW clause
      11. Using the GROUP BY CUBE clause
      12. Using the OFFSET clause
      13. Summary
    11. 4. Functions in SOQL
      1. Using the toLabel() method
      2. Using the GROUP BY clause
      3. Using the COUNT() method
      4. Using the COUNT(Field_Name) method
      5. Using the COUNT_DISTINCT() method
      6. Using the MIN() method
      7. Using the MAX() method
      8. Using the SUM() method
      9. Using the HAVING clause
      10. Summary
    12. 5. Limitations and Best Practices
      1. Standards to be followed in SOQL
      2. Best practices
      3. Limitations in objects
      4. Other limitations
        1. Governor limits
        2. Understanding the limitations of the ORDER BY query
        3. Understanding the limitations of the toLabel() query
        4. Understanding the limitations of the COUNT() query
        5. Understanding the limitations of the OFFSET clause
        6. Limitations of the relationship queries
        7. Notes and Attachments limitations
      5. Summary
    13. 6. Tools with Installation Guidelines
      1. Using the Explorer software
        1. Installing Explorer
      2. Workbench
      4. The Apex Data Loader tool
        1. Downloading Data Loader without the login
      5. Summary
    14. A. Review Questions
      1. Chapter 1
      2. Chapter 2
      3. Chapter 3
      4. Chapter 4
    15. Index

Product information

  • Title: Getting Started with SOQL
  • Author(s):
  • Release date: April 2014
  • Publisher(s): Packt Publishing
  • ISBN: 9781783287352