$arr = array();
$query = $dbh->query('SELECT .......', PDO::FETCH_ASSOC);
$say = 1;
$dur = 100;
foreach($query as $q){
if ($say == $dur) break;
if (in_array($q['id'], $arr)) continue;
echo $q['sütun'];
array_push($arr, $q['id']);
$say++;
}
?>