title: SQL Query direct or inner join
body: <p>i want to find a number of clients from certain dates before and after there was a status changes in their credit history. eg:</p>
  
  <ul>
  <li>date = 2010/07/25</li>
  <li>date2 = 2010/08/30</li>
  </ul>
  
  <p>i want everyone from the table who had a status "pending" before "date"
  and from the same lists of people, i want to identify lists of clients whose status changed from "pending" to "approved" after "date2".  eg </p>
  
  <ul>
  <li>before "date", i had 20k clients with "pending" status</li>
  <li>after "date2", i still have 20k clients but some went from pending to approved and i want to identify these clients</li>
  </ul>
  
  <p>below is my table description:</p>
  
  <ul>
  <li>i have a table that store just unique information</li>
  <li>the second is a transaction table of the first table, that records every single activity with a timestamp. its really detailed minute by minute table records.</li>
  </ul>
  
  <p>i tried doing a direct join with these two tables, but still wasn't sure if i was getting everyone. the reason is, the second transaction table stores every status "states" (pending, approved) and time.</p>
  
  <p>what is common in both tables are: </p>
  
  <ul>
  <li>status</li>
  <li>client_id</li>
  </ul>