On Wed, Sep 05, 2001 at 08:30:53PM +0100, Chris Thorpe wrote:
> Is it possible to modify the following query:
> 
> SELECT COUNT(*) AS pass WHERE test=x AND value BETWEEN low AND high;
> 
> to also count the total number of records where 'test=x'
> and hence return the percentage pass mark all within one statement, or am I
> stuck using 2 statements 1 as above to count the passes and a second :
> 
> SELECT COUNT(*) AS total WHERE test=x;
> 
> to count the total??????
> 
> Chris Thorpe
> Consultronics Europe Ltd
> 

ponder this,
SELECT COUNT(*) AS count, (value BETWEEN low AND high) AS aa WHERE test=x GROUP BY aa;


-- 
-----

DISCLAIMER: Anyone sending me unsolicited commercial electronic mail
automatically agrees to be held to the following legal terms:

US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer meets the
definition of a telephone fax machine. By Sec.227(b)(1)(C), it is
unlawful to send any unsolicited advertisement to such equipment. By
Sec.227(b)(3)(C), a violation of the aforementioned Section is punishable
by action to recover actual monetary loss, or $500, whichever is greater,
for each violation.



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to