Why is the order of tables important when combining an outer & an inner join ? the following fails with postgres:
SELECT grp.number AS number,
For an inner join, the order of the tables is not important.
For an outer join, it is. All the rows from the table on the side specified (is it a LEFT or RIGHT join) will be included, while only rows that match the join criteria will be included from the table on the other side.
Because OUTER JOINS keep all rows from one side, they are said to (in general) increase result sets. INNER JOINS only keep rows from both sides if they match, so they are said (in general) to reduce result sets. Thus, you typically want to do your INNER JOINS before the OUTER JOINS (when possible).
In your case, it's almost certainly a result of the evil A,B syntax.