title: List only unique users
body: <p>Table is <code>users</code>, columns are <code>user_id</code>, <code>firstname</code>, <code>lastname</code>, <code>area</code>.</p>
  
  <p>The other table is <code>user_sessions</code>, and columns are <code>user_id</code>, <code>logon</code>, <code>logoff</code>.</p>
  
  <p>To see who is logged on I use</p>
  
  <pre><code>select u.FIRSTNAME, u.LASTNAME, u.PHONE_ID, us.LOGON 
  from USERS u 
      join USER_sessions us on u.USER_ID=us.user_id 
  where cast (us.LOGON as date) = date 'now' 
  and us.LOGOFF is null 
  order by u.FIRSTNAME
  </code></pre>
  
  <p>The result is correct, but sometimes I get duplicated entries.</p>
  
  <p>For example, same <code>firstname</code> and <code>lastname</code>, but different logon. I'd like to only see the latest logon.</p>