Group By and many columns

Analytics
Teradata Employee

Group By and many columns

Hello!

Is there any quicker way to do a GROUP BY when you have many columns other than listing them all?

So, instead of:

GROUP BY 1,2,3,4,5,6,7,8,9,10,etc...

Is there anything like:

GROUP BY ALL EXCEPT 2 (or similar)

I am pretty sure there isn't but thought I'd check.

Thanks

Andrew
1 REPLY
Teradata Employee

Re: Group By and many columns

If you just want unique values you can use DISTINCT, but this can have slower performance than the group by.

You can also use ordered analytical functions in place of the group by otherwise the answer to your question is "no you can't do that."