title: Many-to-Many Select
body: <p>I have 3 tables:</p>
  
  <p><strong>users</strong>:</p>
  
  <pre><code>id  name
  1   Jack
  2   Vasya
  3   John
  4   Robert
  5   Dmitry
  6   Dylan
  </code></pre>
  
  <p><strong>cities</strong>:</p>
  
  <pre><code>id  city
  1   London
  2   Kyiv
  3   New-York
  4   Chicago
  5   Moscow
  6   Dubai
  </code></pre>
  
  <p><strong>users_cities</strong>:</p>
  
  <pre><code>user_id city_id
  1       1
  3       1
  5       6
  2       3
  4       5
  6       6
  </code></pre>
  
  <p>I need to select users with Jack in London by Jack's id(users.id = 1) or users in Dubai with Dmitry(users.id = 5) using JOIN.
  How could I do it?</p>
  
  <p>What I have tried:</p>
  
  <pre><code>SELECT `u`.`username`, `uc`.`city_id` FROM `users` as `u`
      INNER JOIN `users_cities` as `uc` ON `u`.`id` = `uc`.`user_id`
      INNER JOIN `users_cities` as `uc1` ON `uc1`.`city_id` = `uc`.`city_id`
  WHERE `u`.`id` = 1
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>username    city_id
  Jack        1
  Jack        1
  </code></pre>