title: Get count of a column as well as value of column with specific condition for each group
body: <p>I 'am using sqlserver 2012 ,</p>
  
  <p>I have table that contains column1 and column2  and other columns ,</p>
  
  <p>I want  to get count of column1 as well as  the value of column2 that matches  specific condition  <strong>for each group</strong> </p>
  
  <blockquote>
    <p>the condition is column2 like '%page1%'</p>
  </blockquote>
  
  <pre><code>select  COUNT(column1)  FROM MyTable  group by column1
  </code></pre>
  
  <blockquote>
    <p>what  should I add to this query .</p>
  </blockquote>
  
  <p>Thanks in advance .....</p>