SQL : search from two tables <p>I'm using SQL Server and I have two tables</p> <p><code>player</code>:</p> <pre><code> player guildId -------------------- a 1 b 2 c 2 d 2 e 1 f 1 g 1 </code></pre> <p><code>game</code>: </p> <pre><code> player gameId -------------------- a 4 b 1 c 2 d 1 e 3 f 2 g 2 </code></pre> <p>I want to create a view called view_test,</p> <p>The view's result :</p> <pre><code>select * from view_test where guildId = 2 and gameId = 2 </code></pre> <p>it shows</p> <pre><code> player joined ---------------- b false c true d false select * from view_test where guildId = 2 and gameId = 1 player joined ----------------- b true c false d true select * from view_test where guildId = 2 and gameId = 3 player joined ---------------- b false c false d false select * from view_test where guildId = 1 and gameId = 4 player joined ---------------- a true e false f false g false </code></pre> <p>How can I do this SQL ?</p> <p>Thanks</p>