I have a table like this..:
I am trying to figure out how to query only one of the duplicate entries while still getting the non-duplicate entries?
$query = "SELECT id, size, color FROM `".$item."` WHERE size in (SELECT size FROM `".$item."`
GROUP BY size HAVING COUNT(*)>1)";
$resul = $conn->query ($query);
if($resul->num_rows > 0){
while($r = $resul->fetch_assoc()){
echo $r["size"];
}
}