title: MySQL Query Two Table Join
body: <p>having a little trouble with this query.  I have two tables ...</p>
  
  <pre><code>Account -
  ResourceID (int)
  AccountID (int) (unique auto-inc)
  
  Resource -
  TextName (varchar)
  ResourceID (int) (unique auto-inc)
  CompanyID (int)
  </code></pre>
  
  <p>All I have is the AccountID and I Need to make 1 query that will tell me the TextName and ResourceID of all records in the Resource table who have the same CompanyID as the record in the account table that has the same ResourceID and the AccountID that I provide.</p>
  
  <p>Here is what I have so far and already it has narrowed it down to only one entry ... and I have not even begun to try to incorporate the CompanyID yet. </p>
  
  <pre><code>SELECT r.ResId, r.FirstName, r.LastName
  FROM account a, resource r
  WHERE a.AccId='7' AND a.ResId = r.ResId 
  </code></pre>
  
  <p>Any help is much appreciated.  Thanks</p>