title: select query for multiple chat system
body: <p>I'm making a system of chat similar to facebook, where you can talk with 2 or 3 people in the same time. My issue is on the select the conversation.</p>
  
  <p>inbox_conversation (this table is for create a new id of conversation if the user start to talk the first time)</p>
  
  <pre><code>id_conversation | occured_at
         1           13482942
         2           18583953
  </code></pre>
  
  <p>inbox_join (table for user join on the conversation in this case there is user 1, 2, 3 on the disccussion with id 1)</p>
  
  <pre><code>id_conversation | id_user
        1            1
        1            2
        1            3
        2            4
        2            5
  </code></pre>
  
  <p>inbox_msg (table for record the message sent)</p>
  
  <pre><code>id_conversation | id_user | message | occured_at
       1              1         Hey      1457694
       1              2         Hola     3848374 
       1              3         Cool     3294933
       2              4         Wow      4392934
       2              5         Yes      9485737
  </code></pre>
  
  <p>Now i have to do some query for select the messages having just the id_user of the conversation, in this case i have 1,2,3. Someone can help me to build this query please.</p>
  
  <p>Final result that i'm looking for selecting the discussion with id_user 1,2,3</p>
  
  <pre><code>id_user | message | occured_at
   1         Hey       1457694
   2         Hola      3848374
   3         Cool      3294933
  </code></pre>
  
  <p>PS: if the conversation have 3 users and i try to select just 2 of them i have be able to don't see the conversation.</p>
  
  <p>if I have just the id of the users 1,2 in this case there is no discussion with just that 2 user, but if the user 1 write to user 2 in the database will be another id discussion and will correlate to both user. Like that if i add another user example user 3 he can't see the previous messages sent between user 1 and 2</p>
  
  <p>if is a bad idea select just with id user, i can study some solution for pass the id of discussion.</p>