首页 > 解决方案 > Presto SQL 想在所有列上使用一个函数,如何不将它们一一列出?

问题描述

假设我想要这样的输出:
是否可以在不明确写出所有 100 个列名的情况下复制它?

select main,
count(distinct col1),
count(distinct col2),
...
count(distinct col100),
from table
group by main

标签: sqlpresto

解决方案


推荐阅读