List:General Discussion« Previous MessageNext Message »
From:Mogens Melander Date:April 3 2007 11:17am
Subject:Re: mysql question.
View as plain text  
Hmmm, using "distinct email" in a query where you want
to count email won't work.

select mail, count(mail) as mailcnt from guest
where voted='yes'
group by mail
order by mailcnt;

should do the trick.

On Tue, April 3, 2007 12:51, Me2resh Lists wrote:
> hi
> i need help regarding a sql query in my php app.
>
> the query is :
>     $SQL = "SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes'
> LIMIT $startingID,$items_numbers_list";
>
> i want to sort this query by the number of the repeated EMail counts.
> can anyone help me with that please ?
>
> --
> This message has been scanned for viruses and
> dangerous content by OpenProtect(http://www.openprotect.com), and is
> believed to be clean.
>
>


-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.

Thread
mysql question.Me2resh Lists3 Apr
  • Re: mysql question.Mogens Melander3 Apr