SOQL Typographical Conventions

Topics about SOQL use the following typographical conventions:
ConventionDescription
SELECT Name FROM AccountIn an example, Courier font indicates items that you should type as shown. In a syntax statement, Courier font also indicates items that you should type as shown, except for question marks and square brackets.
SELECT fieldname FROM objectnameIn an example or syntax statement, italics represent variables. You supply the actual value.
?In a syntax statement, the question mark indicates the element preceding it is optional. You may omit the element or include one.
WHERE [conditionexpression]
In a syntax statement, square brackets surround an element that may be repeated up to the limits for that element. You may omit the element, or include one or more of them.
SELECT Name FROM AccountIn some examples, particular elements are highlighted with bold if they are of particular interest in the text before or after the example.

Alias Notation

You can use alias notation in SELECT queries:
 SELECT count() from Contact c, c.Account a WHERE a.name = 'MyriadPubs'

To establish the alias, first identify the object, in this example a contact, and then specify the alias, in this case "c." For the rest of the SELECT statement, you can use the alias in place of the object or field name.

© Copyright 2000-2008 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.