1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pa.options_quantity > 0
ORDER BY (CASE
WHEN products_options_value' at line 5
SELECT products_options_values_name, codigo_tamanho, codigo_cor
FROM products_options_values pov
INNER JOIN products_attributes pa
ON pa.options_values_id = pov.products_options_values_id
WHERE pa.products_id IN () and pa.options_quantity > 0
ORDER BY (CASE
WHEN products_options_values_name like 'PP%' THEN 0
WHEN products_options_values_name like 'P%' THEN 1
WHEN products_options_values_name like 'M%' THEN 2
WHEN products_options_values_name like 'G -%' THEN 3
WHEN products_options_values_name like 'GG%' THEN 4
ELSE pov.products_options_values_name
END)