SOQL

When writing SOQL queries, it is a good idea to keep them readable.

Even though SOQL special words and function names are case insensitive, it is common practice to capitalise them to distinguish them from your table and column names.

// bad

list<account> accounts = [select id, name from account where createddate < today()];

// good

List<Account> Accounts = [SELECT Id, Name
                          FROM Account
                          WHERE CreatedDate < TODAY()]

Last updated