Select rows in a table where id is equals to another id in another table
<p>I would like to select a certain row in my getadvocacy table where id is the id in another table called swimsuit.</p>

<p><strong>swimsuit table</strong></p>

<pre><code>id         |         name          |       average
1          |         Abc           |       90
3          |         Def           |       99
</code></pre>

<p><strong>getadvocacy</strong></p>

<pre><code>id         |        all_scores     |       average_score
1          |        70,70,70       |       70
2          |        70,70,70       |       70
3          |        70,70,70       |       70
</code></pre>

<p>Now, I want to select from getadvocacy but only 1 and 3 because it is the data on swimsuit.</p>

<p><strong>Expected Output</strong></p>

<pre><code>id         |        all_scores     |       average_score
1          |        70,70,70       |       70
3          |        70,70,70       |       70
</code></pre>

<p>I tried this but it has different output.</p>

<pre><code>select getadvocacy.id, all_scores, average_score from getadvocacy WHERE getadvocacy.id IN (select id from swimsuit)
</code></pre>