Hey Danny:

On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote:
> 
> Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1
> Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 
> GROUP BY FIELD1
> 
> Now I want to print a table that prints the values of FIELD1, TOTAL and 
>  SUB.
> 
> Query 1 returns more rows as query 2. Field1 is the same in both queries 
> so I should be able to 'link' the results of both queries together.

I'm wondering exactly what you're trying to do.  It may be possible to do 
in one well crafted query.  Why limit the second query only to items where 
Field2 = 1?  What's in FIELD1 and FIELD2?

Also, I assume you want each row of your HTML table to have the FIELD1, 
TOTAL and SUB fields in them, right?

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409

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

Reply via email to