MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:bert hubert Date:March 13 1999 1:40pm
Subject:Re: Select Count(Distinct <fieldname>) from <table>...
View as plain text  
On Sat, 13 Mar 1999, Hank Eskin wrote:

> The only solution I have used to do this is issue:
>   SELECT <fieldname>, count(*) from <tablename> GROUP BY
> <fieldname>;
> and then get the mysql_NUMROWS (using PHP3).
>  So, is there a way, in one simple query to return this value?

Not yet. I've offered Monty to code it in, but he requested that I wait
for improvements in MySQL making the implementation easier.

A Quick Hack might be possible though. But all it would do is implement
the mysql_numrows trick, discarding the table generated.

bert hubert.

Select Count(Distinct <fieldname>) from <table>...Hank Eskin13 Mar
  • Re: Select Count(Distinct <fieldname>) from <table>...bert hubert13 Mar
  • Re: MySQL 4.0.11 is releasedKen Menzel26 Feb
    • Re: MySQL 4.0.11 is releasedMark Matthews26 Feb
      • Re: MySQL 4.0.11 is releasedLenz Grimmer26 Feb
RE: MySQL 4.0.11 is releasedDuncan Salada26 Feb
  • Re: MySQL 4.0.11 is releasedMark Matthews26 Feb
  • RE: MySQL 4.0.11 is releasedLenz Grimmer26 Feb
    • Re: MySQL 4.0.11 is releasedBenjamin Pflugmann26 Feb
      • Re: MySQL 4.0.11 is releasedLenz Grimmer28 Feb