title: SQL query for last user action
body: <p>I am trying to get an SQL statement to work which will show a list of users in the database and their last action.</p>
  
  <p>The current table format is;</p>
  
  <p>tblUser:<br>
  id, username, password</p>
  
  <p>tblAction:<br>
  id, uid, action, date</p>
  
  <p>The SQL statment I have at present is;</p>
  
  <pre><code>SELECT *
   FROM tblUser
   FULL OUTER JOIN Location
   ON tblUser.id=tblAction.uid
   WHERE action IS NOT NULL
   ORDER BY date DESC
  </code></pre>
  
  <p>I have used <code>limit 1</code> but this hasn't worked.</p>
  
  <p>I have also tried;</p>
  
  <pre><code>SELECT *     
  FROM tblAction T1    
  WHERE date = (
     SELECT max(date)
     FROM tblUser T2
     WHERE T2.uid=T1.id
  </code></pre>
  
  <p>Please could someone help me?
  This is an SQL command to be executed in an admin panel in PHP and is not MySQL.</p>