title: How to do Pivot (Count (*) ) functionality in Snowflake
body: <p>My Query  is as follows:</p>
  <p>I am getting an error &quot;unexpected '*'.&quot; at line 6, please let me know , how to rewrite or correct this issue</p>
  <pre><code>select * from (SELECT gl gl_acc,
                                 reg reg,
                                 mapp map_name,
                                 field as f1
                            FROM gl_acc a
                           WHERE TYPE = 'AGG') PIVOT (count(*)
                                               FOR f1
                                               IN  (
                                                   'JOURN' ,
                                                   'JOU' ,
                                                   'J' ,
                                                   'CASE_' ,
                                                   'JOUR' 
                                                  ))as p;
  </code></pre>
  <p>Thanks,
  Goe</p>