• Even though I got it correct I don't think it is completely correct.

    select col1, col2, "extra" = 'X' from table1 group by col1, col2

    would work even though the column "extra" is a non-aggregate and is not in the group by.