title: SQL query for fetching every first event (by datetime field) in day of a month
body: <p>I have table like <code>events</code>(<code>id</code>, <code>date</code>, <code>event_name</code>, <code>user_id</code>) and records like</p>
  
  <pre><code>(1, '2013-12-01 08:30:00', 'login', 9),
  (2, '2013-12-01 08:33:00', 'login', 4),
  (3, '2013-12-01 10:22:00', 'logout', 9),
  (4, '2013-12-02 08:34:00', 'login', 9),
  ...
  </code></pre>
  
  <p>I need to fetch every first event for each (or specified) user in a day for every days in a month.
  for ex:</p>
  
  <pre><code>2013-12-01 08:30:00, login, 9
  2013-12-02 08:34:00, login, 0
  ...
  </code></pre>
  
  <p>Help me to construct properly SQL query</p>