Join Syntax with loop to left table and list to the columns : <p>I have those 3 tables </p>

<pre><code>Warehouse

Id  name        
1   Warehouse 1     
2   Warehouse 2     


Items

Id  description     
1   Item 1      
2   Item 2      
3   Item 3



itemmovement

itemid     qtyin    qtyout  warehouseid
1            2                   1
1                      1         1
1            2                   2
2            1                   1
2            3                   1
2                      1         1
2            1                   2


Result      
ItemId  SumQuantityWarehouse1   SumQuantityWarehouse2
1              1                         2
2              3                         1
3              0                         0
</code></pre>

<p>I need the result to sum up sum(qtyin)-sum(qtyout) with respect to itemid and warehouseid , by listing all the warehouses in columns with the quantities 
of each item as shown in the result</p>
