Google Fusion Table SQL query where clause-only AND works, not OR?

My SQL query:

SELECT * FROM 1910640 WHERE stype='P' OR stype='ERC' OR stype='PERC' ORDER BY ST_DISTANCE(geometry, LATLNG(-0.12623619999999391,51.5001524)) LIMIT 6 

The result is a "parseerror". If I replace OR with AND, the request returns success:

 SELECT * FROM 1910640 WHERE stype='P' AND stype='ERC' AND stype='PERC' ORDER BY ST_DISTANCE(geometry, LATLNG(-0.12623619999999391,51.5001524)) LIMIT 6 

Has anyone else come across this using Fusion tables and have a solution / workaround?

The API implies only AND allowed, which was a big surprise for me. http://code.google.com/apis/fusiontables/docs/developers_guide.html#Querying

+4
source share
3 answers

OR not supported - check API ref filter_conditions

IN is supported - so you can in all your conditions OR for SType

+4
source

Sorry if I say stupidity, since I never had merge tables, but OR queries can be divided into 2 queries, one for each condition.

The main problem in this workaround is that you must implement ORDER in a programming language when merging both queries.

0
source

You can use IN instead of OR because OR is not supported by merge tables.

http://www.w3schools.com/sql/sql_in.asp

0
source

All Articles