title: Select rows using IN condition and group by
body: <p>I have the following table, which store the suggestion_id and goal_id</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>id|goal_id|suggestion_id
  1 |     12|   1
  2 |     13|   2
  2 |     17|   2
  3 |     14|   1
  4 |     15|   3
  5 |     16|   3
  6 |     12|   4
  6 |     18|   4</code></pre>
  </div>
  </div>
  </p>
  <p>I'd like to query the suggestion_id for a specific combination of goal_ids.</p>
  <p>For instance:</p>
  <ul>
  <li>goal_id(13, 17) =&gt; i need the suggestion id: 2</li>
  <li>goal_id(12, 14) =&gt; i need the suggestion id: 1</li>
  <li>goal_id(14, 12) =&gt; i need the suggestion id: 1</li>
  <li>goal_id(12, 18) =&gt; i need the suggestion id: 4</li>
  </ul>
  <p>Is it even possible to query the suggestion_id this way, or i have to redesign my table?
  (I'm using PostgreSQL database)</p>
  <p>INPUT: (12, 14) or (14, 12) the order of ids may be change</p>
  <pre><code>select suggestion_id from table WHERE goal_id IN(12, 14) group by suggestion_id
  </code></pre>
  <p>The query returns the following  id: 1,1,4</p>