Monday, February 15, 2010

Programmer - Unpivot SQL thingie

Programmer Question

I have some data like:



Chocolate  Strawberies  Oranges
2 3 1
4 2 4


How do i get is back as



Chocolate 2
Chocolate 4
Strawberies 3
Strawberies 2
Oranges 1
Oranges 4


Without using unions and cases?

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails