Błąd zapytania sql : SELECT DISTINCT id,name,price,categoryId,manufacturerId FROM (SELECT id,name,price,0 AS position,categoryId,manufacturerId FROM product WHERE active=1 AND ( LOWER(name) LIKE '%%' OR LOWER(keywords) LIKE '%%' OR LOWER(searchTags) LIKE '%%' OR LOWER(productCode) LIKE '%%') UNION SELECT id,name,price,1 AS position,categoryId,manufacturerId FROM product WHERE active=1 AND ( LOWER(name) LIKE '%%' OR LOWER(keywords) LIKE '%%' OR LOWER(searchTags) LIKE '%%' OR LOWER(productCode) LIKE '%%')) AS t WHERE 1 AND manufacturerId=1 ORDER BY position
Expression #1 of ORDER BY clause is not in SELECT list, references column 't.position' which is not in SELECT list; this is incompatible with DISTINCT