title: SQL SELECT DISTINCT ID from copies ORDER BY CID
body: <p>i want something like this:</p>
  
  <pre><code>SELECT DISTINCT ID from copies WHERE timestamp &lt; 1229444506 ORDER BY CID 
  </code></pre>
  
  <p>the problem is that this one only return ID and i need CID and other columns in the table.</p>
  
  <p>It may be that this is totally wrong for other reason aswell, so i will explain what i need.</p>
  
  <p>I have a table that "record" every row-change in my maintable. This so in the future i will be able to go back in time and see how the main table looked like a certain date in time.</p>
  
  <p>So what i need is a query that ORDER all rows BY CID, WHERE timestamp &lt; 1229444506, AND then DISCTINCT them by ID.</p>
  
  <p>I want to the query to return the first row by ID, when ordered by CID newest first.</p>
  
  <p>Ive tried to get this working with different methods but no luck.
  Any suggestions?</p>