Błąd zapytania sql : SELECT DISTINCT id FROM ( SELECT position,id,name,promotionPrice AS price FROM product WHERE active=1 AND promotion=1 AND promotionTime=0 UNION SELECT position,id,name,promotionPrice AS price FROM product WHERE active=1 AND promotion=1 AND promotionTime=1 AND promotionFromDate<='2021-08-04' AND promotionToDate>='2021-08-04' ) AS q ORDER BY position ASC,price ASC, name ASC
Expression #1 of ORDER BY clause is not in SELECT list, references column 'q.position' which is not in SELECT list; this is incompatible with DISTINCT