title: MySQL - How do I compare values in common between two tables
body: <p>I have two tables.</p>
  <p>TABLE <code>FRIENDS</code> - Columns/Values</p>
  <blockquote>
  <p>ID, FRIEND_ID, FRIEND_NAME</p>
  <p>1, 34, DAMON</p>
  <p>1, 17, RICHARD</p>
  <p>1, 56, DANIEL</p>
  <p>1, 65, CHARLIE</p>
  <p>2, 15, PRISCILA</p>
  <p>2, 17, RICHARD</p>
  <p>2, 45, JOHN</p>
  <p>2, 56, DANIEL</p>
  </blockquote>
  <p>TABLE <code>USERS</code> - Columns/Values</p>
  <blockquote>
  <p>USER_ID, NAME</p>
  <p>1, JUNIOR</p>
  <p>2, SAMANTHA</p>
  <p>15, PRISCILA</p>
  <p>45, JOHN</p>
  <p>56, DANIEL</p>
  </blockquote>
  <p>How do I do a <code>SELECT</code> that query all the rows from table <code>FRIENDS</code> where <code>friends.USER_ID = X</code> and cross reference with all the rows in table <code>USERS</code> where the <code>friends.FRIEND_ID = users.USER_ID</code>.</p>
  <p>Basically I want to query all the friends of a user(from table <code>FRIENDS</code>, identified by <code>friend_id</code>) that also exist in the table <code>USERS</code>(if they exist in the table f<code>riends.FRIEND_ID</code> = <code>users.USER_ID</code>).</p>
  <p>Sorry for the bad english, it's not my native language.</p>