From: Mogens Melander Date: April 3 2007 11:17am Subject: Re: mysql question. List-Archive: http://lists.mysql.com/mysql/205960 Message-Id: <1575.90.184.17.152.1175599041.squirrel@mail.fumlersoft.dk> MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit 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.