title: Group by not returning results in date order
body: <p>In my project when a user views a video it will be inserted into a table which is used to store viewed movies details.</p>
  
  <p>I am using the following query to get the movies viewed by the current user in order of latest records. If the user has viewed a video many times, it should return only the latest record among them.</p>
  
  <p>I am using the following query.</p>
  
  <pre><code>SELECT vm.watched_on,vm.movie_id,cp.channel_id,
  v.title, v.videothumbnail, v.views, v.likes, v.length, v.videoid,
  cp.title as videotitle, cv.thumbnail,cv.views as cvviews,cv.likes as cvlikes, cv.id,cp.starttime,cp.endtime,vm.videotype
  FROM viewedmovies as vm
  LEFT JOIN video as v
  ON (vm.movie_id=v.videoid AND vm.user_id=1 AND vm.videotype=1 and v.permission!=-1)
  LEFT JOIN channel_videos as cv
  ON (vm.movie_id=cv.id AND vm.user_id=1 AND (vm.videotype=0 or vm.videotype=2))
  LEFT JOIN channel_programmes as cp
  ON (vm.movie_id=cp.programme_source AND (vm.videotype=0 or vm.videotype=2) AND cp.status!=-1) 
  where vm.user_id=1 GROUP BY vm.user_id, vm.movie_id, vm.videotype
  ORDER BY vm.watched_on desc
  LIMIT 6
  </code></pre>
  
  <p>Videos are stored in two tables: If the <em>videotype</em> in <em>viewedmovies</em> is 1 it will query from videos table and if the <em>videotype</em> is 0, it will query from <em>channel_programmes</em> and <em>channel_videos</em>. This query is returning results but not in order of date. </p>
  
  <p><a href="http://sqlfiddle.com/#!2/0c382/1" rel="nofollow">http://sqlfiddle.com/#!2/0c382/1</a></p>
  
  <p>Can anyone help me to fix this? Thanks in advance.</p>