$query = "SELECT COUNT(*) as `col`, `title`, GROUP_CONCAT(`id`) as ids FROM `cpl_city` GROUP BY `title` HAVING `col` > 1";
$result = mysqli_query($link, $query) or die('Ошибка 3: '.mysqli_error($link));
$data2 = mysqli_fetch_all($result, MYSQLI_ASSOC);
foreach ($data2 as $dat2) {
$ids .= $dat2['ids'].',';
}
$ids = substr($ids, 0, -1);
$query = "SELECT * FROM `cpl_city` WHERE `id` IN ($ids)";
$result = mysqli_query($link, $query) or die('Ошибка 4: '.mysqli_error($link));
$data1 = mysqli_fetch_all($result, MYSQLI_ASSOC);
Не соображу, как это объединить. Интересно для общего развития. И можно ли?