Re: [PHP-DB] mysql question.

2007-04-03 Thread Dimiter Ivanov

On 4/3/07, Me2resh Lists [EMAIL PROTECTED] 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 ?



$SQL = SELECT EMail,count(EMail) AS repeated FROM mena_guests WHERE
Voted = 'yes' GROUP BY EMail ORDER BY count(EMail)  LIMIT
$startingID,$items_numbers_list;

I can't remember if in the order clause you can order by the alias of
the field or using the count again, test it to see what's the proper
syntax

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] mysql question.

2007-04-03 Thread Haydar TUNA
Hello,
 I try your SQL statements. There is no problem on your SQL syntax 
and you can use alias in the order by clause.:)

 $SQL = SELECT EMail,count(EMail) AS repeated FROM mena_guests WHERE
Voted = 'yes' GROUP BY EMail ORDER BY repeated  LIMIT
$startingID,$items_numbers_list;


-- 
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

Dimiter Ivanov [EMAIL PROTECTED], haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
 On 4/3/07, Me2resh Lists [EMAIL PROTECTED] 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 ?


 $SQL = SELECT EMail,count(EMail) AS repeated FROM mena_guests WHERE
 Voted = 'yes' GROUP BY EMail ORDER BY count(EMail)  LIMIT
 $startingID,$items_numbers_list;

 I can't remember if in the order clause you can order by the alias of
 the field or using the count again, test it to see what's the proper
 syntax 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL Question

2001-04-18 Thread Jason Stechschulte

On Tue, Apr 17, 2001 at 05:52:53PM -0400, Peter J. Krawetzky wrote:
 How do you move the database files to another location in MySQL?  I am
 running Redhat 7.1 with MySQL version 3.23.33.

You ask the appropriate list @ [EMAIL PROTECTED]  

Of course by the time you do so, you have already searched the archives
@ http://www.mysql.com/documentation/searchlists.html

As well as simply looking on the site @ http://www.mysql.com

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
Randal said it would be tough to do in sed.  He didn't say he didn't
understand sed.  Randal understands sed quite well.  Which is why he
uses Perl.   :-)  -- Larry Wall in [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]