Search code examples
google-fusion-tables

FusionTable API Query LIKE operator and wildcards


When i use wildcards based on the LIKE documentation linked from here the query does not work.

SELECT * FROM mytable WHERE country LIKE 'Cana%'

finds no matches and returns a Bad Request 400. It works when i replace 'Cana%' with 'Canada', returning all records containing 'Canada'.

  • How can i write the query to work with wildcards?
  • Does LIKE work with Regular Expressions?

Thanks in advance.


Solution

  • It would be important to know, how you send the request.

    The % is used for encoding inside URLs , try to use %25 instead of % .
    ( %25 is the url-encoded percent-sign)

    Example:( Table )

    SELECT Kilograms FROM 1GVGnBtjVXdwvVjLNVwbP_Pzy_I6rbqu0gv5njBM where Country LIKE 'Can%25'