You appear to be using an EAV-like schema.
To query multiple values in EAV you have to join the same table multiple times. e.g.
SELECT item,name,sale_price,producer,producer_code,store_price,I.type_name
FROM
item
INNER JOIN unit_type ON unit_type_fk=unit_type
INNER JOIN item_store ON item=item_fk)AS I
INNER JOIN item_attribute AS a1 ON I.item = a1.item_fk
INNER JOIN item_attribute AS a2 ON I.item = a2.item_fk -- note second join
WHERE store_price BETWEEN 200.0 AND 300.0
AND (UPPER(a1.value_text) LIKE UPPER('%b%') AND a1.item_attribute_type_fk=1)
AND (UPPER(a2.value_text) LIKE UPPER('%2%') AND a2.item_attribute_type_fk=4)
GROUP BY item, I.type_name
ORDER BY item
Consider transitioning to using json
or hstore
for your attributes. It's lots less painful to query.