Search code examples
google-fusion-tables

Google Fusion Tables : when filtering a text column, how to ask "contains A" AND "contains B" (ditto for OR and NOT)?


Beginner's question : I am creating a Fusion Table with one of the columns being a column of tags, e.g. :

  1. New York, London, Paris
  2. Berlin, Tokyo
  3. New York, Tokyo
  4. Paris, Rome, Tokyo
  5. Paris, Berlin, London

The Filter dropdown (blue) provides me with checkboxes for the 5 above examples, but allows me also to enter a specific text as a query. How must I proceed to enter the equivalent of :

  • Paris AND London (results 1 and 5)
  • Berlin OR Tokyo (results 2, 3, 4 and 5)
  • Paris NOT New York (results 4 and 5)

Thanks in advance


Solution

  • You can use the WHERE IN ('New York', 'London', 'Paris')

    Your IN (xxx,xxx,xxx) will depend on list of cities. The IN operator implies an OR condition. Not sure how an AND condition would work in your case. See: https://developers.google.com/fusiontables/docs/v1/sql-reference#Select and search for <column_condition>