title: Sql left join with 2 columns
body: <p>I have a problem with left join i have 2 tables. Table A:</p>
  
  <pre><code>Itemid InventlocationID
  10001    200
  10001    301
  10001    302
  </code></pre>
  
  <p>And table B</p>
  
  <pre><code>ItemId InventLocationID ItemOption
  10001    200               A
  10001    301               B
  </code></pre>
  
  <p>I want to get the following result</p>
  
  <pre><code>Itemid InventlocationID ItemOption
  10001    200                A
  10001    301                B
  10001    302               null
  </code></pre>
  
  <p>I use left join:</p>
  
  <pre><code>SELECT a.itemid,a.inventlocationid,b.ItemOption
  FROM  a
  left  join b
  on (a.ItemID = b.ITEMID and a.InventLocationid = b.INVENTLOCATIONID)
  </code></pre>
  
  <p>and the result i get is:</p>
  
  <pre><code>Itemid InventlocationID Itemoption
  10001    200                A
  10001    301                B
  </code></pre>
  
  <p>Any ideas how can i achieve the result i want?
  Edit : tables a and b have more records</p>