• Before answering I was wondering if missing ALL on final union was intentional or a typo.

    Count(*) counts all rows, Count([ALL] column) counts rows where column is not null, so it doesn't matter whether final union is just "union" or "union all".

    Fun question anyway. 🙂