Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
CREATE TEMPORARY TABLE `t_temp` as ( SELECT MAX(ID) as ID FROM `table` GROUP BY post_id, meta_key ); DELETE from `table` WHERE `table`.ID not in ( SELECT ID FROM t_temp );
SELECT r.name, d.* FROM data AS d INNER JOIN cities AS c ON c.id=d.location INNER JOIN regions AS r ON r.id = c.parentid