title: Display Count and distinct values for all columns in a table
body: <p>I have a table with 700 columns. I am trying to get a list of distinct values for each column and their count. I am using the below query to get the result for 1 column</p>
  
  <pre><code>Select distinct col1, count(*) from MyTable group by 1.
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>col1    count(*)
  a       10
  b       20
  c       40
  </code></pre>
  
  <p>How can I get the result for all columns using a single query in the most optimal way?</p>