Как получить среднее в SQL в PHP

$result = mysql_query("SELECT AVG(fieldName) AS avg FROM tableName");
$row = mysql_fetch_assoc($result); echo $row['avg']
Amused Ant