title: To count the number of occurence of a particular value in a table
body: <p>I have a table as shown below</p>
  
  <pre><code>Col1    Col2    Col3
  *         $       *
  $         *       *
  #         *       $
  %         *       *
  *         *       $
  *         @       $
  </code></pre>
  
  <p>I want a sql query to count the number of stars(*) present in the table. </p>
  
  <p>one option is to write the query in the following manner.</p>
  
  <pre><code>select ((select count(*) from star_table where col1='*') + 
  (select count(*) from star_table where col2='*') +
  (select count(*) from star_table where col3='*')) as count from dual.
  </code></pre>
  
  <p>I want to know if there is an alternative way of writing the query to get the same result. </p>