title: Get records for the latest timestamp in SQLite
body: <p>I know this question has been asked before by others but all those questions use either MySQL or other databases. How to do in SQLite? I am asking since SQLite doesn't have a separate date data type. I have created the table with this schema</p>
  
  <p>Fragment:</p>
  
  <pre><code>CREATE TABLE x (
  id INTEGER NOT NULL,
  timestamp TIMESTAMP NOT NULL,
  PRIMARY KEY(timestamp,id)
  );
  </code></pre>
  
  <p>Will something like this work?</p>
  
  <pre><code>SELECT * FROM x
  WHERE DATE(timestamp) = (
      SELECT MAX(DATE(timestamp)) FROM x
  )
  </code></pre>