title: how to get unique data which latest in SQL with JPA?
body: <p>I have duplicate phone_id but have a different name, on my database I have 3 columns, phone_id, name, created_at</p>
  
  <pre><code>1. phone_id: 111, name: David, created_at: 10:30
  2. phone_id: 122, name: Shinta, created_at: 7:10
  3. phone_id: 111, name: Juan, created_at: 11:36
  </code></pre>
  
  <p>i do love to get only the last created_at</p>
  
  <p>so the result is </p>
  
  <pre><code>phone_id: 111, name: Juan, created_at: 11:36
  phone_id: 122, name: Shinta, created_at: 7:10
  </code></pre>
  
  <p>when I use :</p>
  
  <pre><code>*SELECT * FROM Contacts GROUP BY phone_id*
  </code></pre>
  
  <p>it gets the result David and Shinta because David created the first time, but that is the result I don't want </p>
  
  <p>i want the result is Juan and Shinta
  what is the syntax for to get unique based on last created ? </p>