SQL Server count number of distinct values in each column of a table

前端 未结 5 968
别跟我提以往
别跟我提以往 2020-12-10 10:06

I have a table with ~150 columns. I\'d like to find the count(distinct(colName)) for each column but am wondering if there\'s a way to do so without actually t

5条回答
  •  星月不相逢
    2020-12-10 10:17

    I don't believe this is possible with just MySQL. I would think your going to have to use a server side language to get the results you want.

    Use "DESC TABLE" as your first query and then for each "field" row, compile your query.


    Ignore this, wrong system tag :)

提交回复
热议问题