first off, change your 'sku' field to be solely numeric
Next I would alter your select statement to order by sku first, and pertinance second
Third, during your while statement, only use the first entry from each sku
This shoudl accomplish what you've described.
sku | keyword | pertinance
1 | something | 1 <-- More pertinant
1 | blah | 2 <-- Less pertinant
2 | foo | 1
2 | bar |1
2 | biz |2
2 | baz |3
$get_entries = mysql_query("select * from skutable order by sku, pertinance desc") or die(mysql_error());
$sku_used = "0";
while ($row=mysql_fetch_array($get_entries))
{
if ($row[sku] != $sku_used)
{
echo "Most pertinant Sku:<br>\n";
echo $row[keyword] . "<br><br>\n";
$sku_used = $row[sku];
}
}