我有一个大约 150 列的表。我想count(distinct(colName))
为每一列找到 ,但我想知道是否有办法在不实际输入每一列名称的情况下这样做。
理想情况下我会使用count(distinct(*))
,但这不起作用。
还有其他建议吗?
编辑:
如果这是我的桌子:
id col1 col2 col3 ...
01 10001 west north
02 10001 west south
03 10002 east south
04 10002 west north
05 10001 east south
06 10003 west north
我正在寻找这个输出
count(distinct(id)) count(distinct(col1)) count(distinct(col2)) count(distinct(col3))
6 3 2 2