title: SQL statement selecting rows from a table dependent on information from another table
body: <p>I have two different tables in a database, differing in number of columns. Now, I want to select a number of rows from the first table dependent on some variable (for example that the first column should have the value 1). However, I would also like to use information from my other table to select rows from my first table.</p>
  
  <p>In my specific case, both <code>table1</code> and <code>table2</code>contains the columns <code>Group</code> and <code>Person</code>. Table1 specify each person once, and declares what group he or she belongs to. However, people can also be part of secondary groups, which are listed in <code>table2</code>. That is, in <code>table2</code>, a person can be listed again with a new group number.</p>
  
  <p>I would like to write an SQL statement where I select persons (that is, rows) from <code>table1</code> (since I have more information about the persons in this table) that are members of a certain group, <code>x</code>. However, since a person can belong to several groups, I need to look through <code>table2</code> as well, somehow.</p>
  
  <p>How can I write this SQL statement?</p>