title: Two tables JOIN
body: <p>I am trying to improve my SQL skills but it's really not easy. When I think I improved a bit I encounter a basic SQL problem and I can't move forward. I have two tables. The only column that they have in common is a column &quot;order&quot;. I would like to select a client who has both products (it doesn't matter if these products he/she purchased in one order or more). In my example this client is no. 345:</p>
  <p><a href="https://i.stack.imgur.com/7QWPy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7QWPy.png" alt="enter image description here" /></a></p>
  <p>My code looks like this but it doesn't really solve my problem, because it lists people who purchased one product or both products:</p>
  <pre><code>select t2.client, t1.product, t1.order
  from table_1 t1
  join table_2 t2 on t1.order = t2.order
  where product in ('a', 'b')
  order by t2.client
  </code></pre>