Pregunta

Why is this SOQL query returning MALFORMED_QUERY: unexpected token: on

Select id FROM account 
where id = '0012000000I7MkRAAV' or id = '0012000000I7MkRAAV' 
and id = '0012000000I7MkRAAV'

Changing "and" to "or" returns the result just fine:

Select id FROM account 
where id = '0012000000I7MkRAAV' or id = '0012000000I7MkRAAV' 
or id = '0012000000I7MkRAAV'

I am executing the query in Force explorer.

¿Fue útil?

Solución

You need to group your and/or's so that its not ambiguous, e.g.

Select id FROM account where id = '0012000000I7MkRAAV' or (id = '0012000000I7MkRAAV' and id = '0012000000I7MkRAAV')

Otros consejos

The problem is that one account record can't has two ids in the same time. One object record has just one Id. In this query you can use only OR statement

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top