El mié, 13-09-2006 a las 13:16 +0200, Oscar Rodriguez Fonseca escribió:
> A query (UNTESTED) that should solve your problem may be this one:
>
> SELECT a.count AS "t1fielda",
> b.count AS "t2fielda",
> c.count AS "t2fieldb",
> d.avg AS "t2avgc"
> FROM (SELECT count(*) FROM t1 WHERE fielda = TRUE) AS a
> JOIN (SELECT count(*) FROM t2 WHERE fielda = TRUE) AS b ON TRUE
> JOIN (SELECT count(*) FROM t2 WHERE fieldb = TRUE) AS c ON TRUE
> JOIN (SELECT avg(fieldc) FROM t2) AS d ON TRUE;
>
> I am also a DB novice so this is correct.
Sorry, I was trying to write:
"I am also a DB novice so I HOPE this is correct".
Best regards.