GROUP BY in a Multiple SELECT
<p>Say I have four tables with the same format:</p>

<pre><code>Registered  |  Score
----------------------
0           |  10
1           |  5
1           |  7
0           |  6
</code></pre>

<p>And I want to get the <code>Score</code> average for each one grouped by <code>Registered</code> field (0,1). In a multiple <code>SELECT</code> the not grouped query that returns a single result as a row of four columns would be:</p>

<pre><code>SELECT t1avg.a,t2avg.b,t3avg.c,t4avg.d FROM
(SELECT AVG(score) as a FROM table1) AS t1avg,
(SELECT AVG(score) as b FROM table2) AS t2avg,
(SELECT AVG(score) as c FROM table3) AS t3avg,
(SELECT AVG(score) as d FROM table4) AS t4avg
</code></pre>

<p>But how can I group it to get two results, by registered and not registered users? :</p>

<pre><code>t1avg.a  |  t2avg.b  |  t3avg.c  |  t4avg.d  |  Registered
--------------------------------------------------
8        |  4.5      |  8        |  4.5      |  0
--------------------------------------------------
6        |  6.5      |  5        |  6        |  1
</code></pre>