SELECT f.* FROM flat AS f LEFT JOIN history as h ON (f.id = h.id_flat) WHERE (f.cheap_flat='checked') AND (h.flag_delete <> '1') GROUP BY f.id ORDER BY MAX(h.date) desc limit 0, 10000
Mysql query error: Got error 28 from storage engine