Improved support of SUMMARIZECOLUMNS syntax

Now SUMMARIZECOLUMNS formats correctly even when there are no columns before table expressions or aggregations, and/or when there are multiple tables before the aggregations.