SELECT FROM_UNIXTIME(t2.datein, '%d.%m.%Y'),ROUND(MIN(t2.price),0) AS avgprice, cuid FROM cache.top AS t2 where t2.cuid= and t2.flightFrom=8
GROUP BY datein, cuid ORDER BY avgprice limit 1;You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and t2.flightFrom=8
GROUP BY datein, cuid ORDER BY avgprice limit 1' at line 1