I would like to produce a query that takes columns of data and sorta crosstabs it.
For example, I have a table with the following column headings:
TREENUM, HT01avg, HT01stdev, HT01min, HT01max, WD01avg, WD0102stdev, WD02min, WD02max (note that HT01=Height and WD01=Width)
I would like an SQL solution to crosstab it so it has the following Column Headings:
TREENUM, *TRAIT, avg, stdev, min, max
*TRAIT in this case will equal the front part of the column name (in this case, HT01 and WD01)
I have NO IDEA where to start and unfortunately am restricted to using the latter format as a base table.
Any help would of course be most appreciated.
Cheers
Shannon
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
For example, I have a table with the following column headings:
TREENUM, HT01avg, HT01stdev, HT01min, HT01max, WD01avg, WD0102stdev, WD02min, WD02max (note that HT01=Height and WD01=Width)
I would like an SQL solution to crosstab it so it has the following Column Headings:
TREENUM, *TRAIT, avg, stdev, min, max
*TRAIT in this case will equal the front part of the column name (in this case, HT01 and WD01)
I have NO IDEA where to start and unfortunately am restricted to using the latter format as a base table.
Any help would of course be most appreciated.
Cheers
Shannon
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)