-1

I have to get distinct values of all the columns for more than 50 tables in Teradata, is there any easy way to do that?

I don't want to keep on typing

select count(*), count(distinct A), count(distinct B), ....... 
from xyz;
  • 1
    read this then reconsider your question https://stackoverflow.com/questions/7853013/retrieving-column-and-other-metadata-information-in-teradata "dynamic sql" springs to mind – Paul Maxwell Nov 14 '17 at 06:41
  • for executing dynamic sql look here: https://stackoverflow.com/a/13896108/2067753 – Paul Maxwell Nov 14 '17 at 06:43

1 Answers1

-2

Instead of Distinct you may try GroupBy.

Mohammed Noureldin
  • 14,913
  • 17
  • 70
  • 99
Arvind AK
  • 1
  • 1