How to select rows from hubDB table that are NOT LIKE a specific string?

Since there’s no way to combine queries with an OR, I tried to get data from hubDB table by excluding something

{% set dbQuery = ‘Artikelnummer=’ + nr + ‘&imagetype__not_like=Logos’ %}

This query returns the data that is LIKE the string “Logos”
What is my mistake? How can I modify this to get the NOT LIKE “Logos” data?

@Marileen,

You are trying to do the logic in the query but you should consider only collecting the variables from the query then creating the logic in the template using those variables

http://www.website.com/?q1=query_1&q2=query_2

{% set query_1 = request.query_dict.q1 %}
{% set query_2 = request.query_dict.q2 %}

{% if query_1 and query2 %}
 {% for rows in database %} {% if query_1 is in row %} {% unless query_2 is in row %} {% endunless %} {% endif %} {% endfor %}
{% elif query_1 %}

{% %}

I didn’t take the time to look up the proper syntax for this but the jist is here and you can find the syntax in the HubL docs.