I have an InventoryStock table structured like:
ItemCode | LocationCode | UnitsInStock |
Item1 | Location1 | 1 |
Item1 | Location2 | 2 |
Item2 | Location1 | 3 |
Item2 | Location2 | 4 |
I would like run a SELECT statement that will output:
ItemCode | Units in Location1 | Units in Location2 |
Item1 | 1 | 2 |
Item2 | 3 | 4 |
Adding a WHERE clause to return either Location1 or Location2 is easy enough, but I can't figure out how to return a second columns with a second where clause.
Any help would be appreciated.
Thanks!