Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Select on one column and return as two colums

$
0
0

I have an InventoryStock table structured like:

ItemCodeLocationCodeUnitsInStock
Item1Location11
Item1Location22
Item2Location13
Item2Location24

I would like run a SELECT statement that will output:

ItemCodeUnits in Location1Units in Location2
Item112
Item234

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!


Viewing all articles
Browse latest Browse all 23857

Trending Articles