title: SQL query, LEFT JOIN but only get one value
body: <p>I'm trying to do a LEFT JOIN to a table that can contain multiple values that meet my criteria, but I only want to select one of them.</p>
  <pre><code>Table1
  sId
  123X
  
  Table2
  sId       Type     EDate         xId
  123x      XX       8/19/2022     144
  123x      XX       8/19/2022     145
  </code></pre>
  <p>What I'm trying to achieve:</p>
  <pre><code>sId     xId
  123x    144
  </code></pre>
  
  <pre><code>SELECT t1.sId, t2.xId
  FROM table1 t1 
  LEFT JOIN table2 t2 ON t1.sId = t2.sId AND t2.Type='XX'
  </code></pre>