title: Ranking values for each date in SQL
body: <p>I am using SQL Server 2005. Please consider the following example: </p>
  
  <p><strong>Table definition and example data</strong></p>
  
  <pre><code>create table my_table
  (
    issueid nchar(10) not null,
    date datetime not null,
    rate numeric(18,9),
    rate_roll numeric(18,9)
  );
  
  insert into my_table
  (issueid, date, rate)
  values ('1', '20140131', '0.6'),
  ('3', '20140131', '0.6'),
  ('1', '20140228', '0.4'),
  ('2', '20140228', '0.4'),
  ('3', '20140228', '0.4'),
  ('1', '20140331', '0.7'),
  ('2', '20140331', '0.7'),
  ('3', '20140331', '0.7'),
  ('1', '20140430', '0.1'),
  ('2', '20140430', '0.1'),
  ('3', '20140430', '0.1');
  </code></pre>
  
  <p><strong><a href="http://sqlfiddle.com/#!2/7cbc81" rel="nofollow">SqlFiddle</a></strong></p>
  
  <p><strong>I would like to rank the <code>rate</code> column for each of the dates. I know how to do this for one date:</strong></p>
  
  <p><strong>My query</strong></p>
  
  <pre><code>select issueid, date, rate,
  DENSE_RANK() over (order by rate desc) AS Rank
  from my_table
  where date = '20140131'
  and rate is not null
  order by Rank
  </code></pre>
  
  <p>Could you anyone please help me tweak this query so that I can do this for each date? Thanks in advance!</p>