Created
May 26, 2015 19:21
-
-
Save NPS-ARCN-CAKN/9c91fcb7fc5de27c97f8 to your computer and use it in GitHub Desktop.
Example of an UNPIVOT query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use ARCN_Sheep | |
SELECT Survey, LegacyUnitID, Category, n | |
FROM [CompositionCountsByUnit]UNPIVOT (n FOR Category IN (Ewes, EweLike, Lambs, Rams_LessThanFullCurl, Rams_FullCurl, UnclassifiedRams, UnclassifiedSheep, | |
Yearlings, Rams1_2Curl, Rams3_4Curl, Rams7_8Curl, Rams1_4Curl, Rams_GT_7_8Curl)) u; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment