At 10:06 PM -0300 06/24/2000, Nasir Ali wrote:
>Hi folks!
>
>Following is my query that returns the disctinct entries in the database
>named "hd".
>
>$result=mysql_query("SELECT DISTINCT hd_type, hd_brand, mb, cyl, heads,rpm,
>HD_cmt
> FROM hd_tbl
> ORDER BY hd_type, hd_brand,
>mb DESC",$db);
>
>My question is, is there any way to count how many distinct entries there
>are in each row. I'm using PHP3 with mySQL. Thanks for the help. I know
>I can write a function to do this but just wondering if there is any built
>in mySQL function available for this.
If you're using MySQL 3.23, you can use COUNT(DISTINCT col1[,col2,...])
--
Paul DuBois, paul@stripped