1SELECT
2    a,
3    b,
4    c
5FROM
6    tablea
7    JOIN tableb ON (tablea.a = tableb.a)
8    JOIN tablec ON (tablec.a = tableb.a)
9    LEFT OUTER JOIN tabled ON (tabled.a = tableb.a)
10    LEFT JOIN tablee ON (tabled.a = tableb.a)
11WHERE
12    tablea.x = 1
13    AND tableb.y = 1
14GROUP BY
15    tablea.a,
16    tablec.c
17ORDER BY
18    tablea.a,
19    tablec.c;
20
21