Open santjosie opened 3 years ago
Hey @santjosie good catch, and your solution is spot on. The reason this doesn't work is the %
character has a special meaning in URLs: it's used to encode special characters (e.g. ^
is represented as %5E
, and—a more commonly seen one—a space is represented as %20
). As you've rightly pointed out, %25
is the encoded representation of a percentage character.
I agree the documentation should make this clearer. I don't maintain this repo anymore, but I'm sure the maintainers would be open to a pull request if you'd like to propose the specific change. You can edit this file and propose your changes be pulled in.
When using the LIKE operator for pattern matching in a query, we can't pass the wildcard '%' in the URL. This throws an error. The documentation seems to suggest otherwise.
The example that I was looking at is the documentation for the end-point to the data in opa_properties_public.
https://cityofphiladelphia.github.io/carto-api-explorer/#opa_properties_public
There are two issues here:
Instead, the pattern matching can be done by issuing
SELECT * FROM opa_properties_public WHERE mailing_address_1 LIKE 'OF PHIL%25'