You need to sign in to do that
Don't have an account?

Parenthesis requirements in SOQL??
Is it now, or has it ever been, possible to submit a SOQL statement similar to this:
SELECT firstname, lastname, email, id from CONTACT WHERE FIRSTNAME = 'scott' AND LASTNAME='last' OR LASTNAME='last2'
Using sforce Explorer, I get a MalformedQuery Exception and have to add parens to the statement:
SELECT firstname, lastname, email, id from CONTACT WHERE FIRSTNAME = 'first' AND (LASTNAME='last' OR LASTNAME='last2')
Is there no order of precedence for ANDs and ORs in SOQL? Or is precedence only determined by using parens?
Thanks
Hi ScottG,
We do require explicit order preference by way of parens.