benjammin
benjammin

Reputation: 537

Simple App Engine Query Invalid

I'm getting an 'Invalid GQL query string' with this seemingly trivial GQL query:

SELECT * FROM Event WHERE firstPlayer='glowingEthers' OR secondPlayer='glowingEthers'

It works fine when the OR clause is removed, for either property. These properties for the Event table are mutually exclusive (no event has both firstPlayer and secondPlayer set to the same player). Any ideas?

Upvotes: 0

Views: 120

Answers (2)

Dan Holevoet
Dan Holevoet

Reputation: 9183

GQL doesn't have an OR operator (as noted here). Since you've stated the result sets are mutually exclusive, you should perform two queries (one for firstPlayer and one for secondPlayer) and join them yourself.

Upvotes: 3

Christian K.
Christian K.

Reputation: 538

maybe this will help (just knowing mySQL) ...

SELECT * 
FROM Event 
WHERE 1 
AND (firstPlayer='glowingEthers' OR secondPlayer='glowingEthers')

Upvotes: 0

Related Questions