title: Getting records with month by month, year by year and day by day from SQL Server
body: <p>I'm looking for a fast and easy SQL Query to get records year by year, month by month and day by day.</p>
  
  <p>My database example:</p>
  
  <pre><code>ID - DATE        - CatID - VALUE
  1  - 2013-08-06  -  32   -  243
  2  - 2013-08-16  -  2    -  45
  3  - 2013-08-21  -  2    -  1
  4  - 2013-08-05  -  32   -  450
  5  - 2013-08-05  -  32   -  449
  6  - 2013-08-05  -  32   -  11
  7  - 2013-08-01  -  2    -  221
  8  - 2013-08-02  -  32   -  0
  9  - 2013-08-02  -  32   -  0
  10 - 2013-08-02  -  32   -  987
  ...
  ..
  </code></pre>
  
  <p>I have over 2 millions records on this table.</p>
  
  <p><strong>First:</strong></p>
  
  <p>I would like to get CatID = 32 and single/higher record of the day.</p>
  
  <p>Result: </p>
  
  <pre><code>1  - 2013-08-06  -  32   -  243
  4  - 2013-08-05  -  32   -  450
  10 - 2013-08-02  -  32   -  987
  </code></pre>
  
  <p><strong>Second:</strong></p>
  
  <p>I would like to get as same but by <strong>MONTH</strong>. </p>
  
  <p>How can I do it with SQL SERVER. Currently Sql Server 2012.</p>
  
  <p>Also using C# 5 and if you want to use, EF 6.</p>
  
  <p><strong>Down voters, this question became "popular question". Now please explain why down voted?</strong></p>