title: SQL statement to get individual values from multiple rows from right table as columns in output
body: <p>I have two tables:</p>
  <p>Table A:</p>
  <pre><code>ID  
  1
  2
  3
  4
  5
  </code></pre>
  <p>Table B:</p>
  <pre><code>ID  UDFNumber UDFValue
  1   5         ID1sUDF5Value
  1   6         ID1sUDF6Value
  1   7         ID1sUDF7Value
  1   8         ID1sUDF8Value
  1   9         ID1sUDF9Value
  2   5         ID2sUDF5Value
  2   6         ID2sUDF6Value
  2   7         ID2sUDF7Value
  2   8         ID2sUDF8Value
  2   9         ID2sUDF9Value
  etc
  </code></pre>
  <p>I am trying to output the values of only UDF5 and UDF9 as columns for each row in table A.</p>
  <p>Output I am looking for:</p>
  <pre><code>ID  UDF5            UDF9
  1   ID1sUDF5Value   ID1sUDF9Value
  2   ID2sUDF5Value   ID2sUDF9Value
  3   ID3sUDF5Value   ID3sUDF9Value
  </code></pre>
  <p>etc.</p>
  <p>What join/sql statement would produce that result? MS SQL Server.</p>