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 colour <> '' AND colour IS NOT NULL AND ' at line 8
El problemo: SELECT colour, stock_type, min(id) as id FROM desk_accessories_stock WHERE wrt_instrument_id = AND colour <> '' AND colour IS NOT NULL AND hidden = 0 GROUP BY colour, stock_type ORDER BY id