title: Select value from only the first record in a group
body: <p>I have a database that contains transaction records. Each record belongs to a chain of transactions, and these have an TCID (Transaction Chain ID) that they share. Each transactions contains a sender and a receiver. What I need to do is check to see if the final receiving user in a chain is ever the same as the first sender in another chain.</p>
  
  <p>Currently, my MySQL query returns records where the final receiver is in any transaction of another chain, not just the first. I need to limit this strictly to final receiver and first sender.</p>
  
  <p>I tried using group by, order by, and limit 1, but these are applied after the query finds some records. Here's the query I had tried so far:</p>
  
  <p><code>SELECT TCID FROM transactions WHERE senderUID = '$receiverUID' GROUP BY TCID LIMIT 1</code></p>
  
  <p>Anyone know of a way that I can search only the senderUID of the first (lowest TID) record in a group (TCID)?</p>
  
  <p>Thanks for your help!</p>