Counting Distinct Rows in MySQL
Posted: Mon Apr 28, 2003 10:55 pm
im trying to count the distinct rows in one of my tabels. Ive tired...
and....
Niether worked... anyone have any idea why?
Thanks!
Code: Select all
$sql = "SELECT COUNT(DISTINCT) FROM hits";
$distinct = mysql_query( $sql );
echo "Unique Hits: " . $distinct ;Code: Select all
$sql = "SELECT DISTINCT FROM hits";
$distinct = mysql_num_rows( mysql_query( $sql ) );
echo "Unique Hits: " . $distinct ;Thanks!