You would expect to be able search a hubDB table for a string containing ampersand (&) or similar special characters, but it is not as easy.
Problem
HubSpot HubL
{#
Let us search for rows with a column matching "Sweet & Sour"
#}
{% set needle = "Sweet & Sour" %}
{% set rows = hubdb_table_rows("table_one", "column_one=" ~ needle) %}
{{ rows }}
{#
You would expect "rows" above to return rows matching "Sweet & Sour", but it will not! HubSpot will not automatically "escape" ampersand in the string. Instead above will return rows where "column_one" matches "Sweet".
#}
Solution
HubSpot HubL
{#
To get around this issue, you would load all of the rows from the table into an array and then search the array for "Sweet & Sour".
#}
{% set needle = "Sweet & Sour" %}
{% set matching_rows = [] %}
{% set rows = hubdb_table_rows("table_one", "column_one__not_null=&limit=1500") %}
{{ rows }}
{% for row in rows %}
{% if row.column_one == needle %}
{% if row.hs_id not in matching_rows|map("hs_id") %}
{% do matching_rows.append(row) %}
{% endif %}
{% endif %}
{% endfor %}
{{ matching_rows }}
{#
Notes:
* on line 7 we're fetching up to 1500 rows of possible matches (i.e. rows where "column_one" is not null); if you expect to get more then 1500 results, you'd wrap hubdb_table_rows into a loop
* on line 12 we're checking previous matches so as to avoid having duplicates
* mind the HubDB technical limits
#}
When implementing the above solution, mind the HubDB technical limits!