Re: [GENERAL] big un stacking query - help save me from myself

2013-03-15 Thread Kevin Grittner
Kirk Wythers wrote: > Here is a simplified version of the query approach I am > attempting. > CREATE TABLE unstacked_table AS ( > SELECT > var1, > var2, > var3, > MAX ( > CASE > WHEN variable_name = 'unstack1' THEN > > VALUE

Re: [GENERAL] big un stacking query - help save me from myself

2013-03-15 Thread Kirk Wythers
On Mar 14, 2013, at 10:27 AM, Kevin Grittner wrote: >> > > I didn't understand your description of what you are trying to do, > and the example has so many columns and cases that it would take a > long time to understand it. Can you distill this down to just a > few columns and cases so that i

Re: [GENERAL] big un stacking query - help save me from myself

2013-03-14 Thread Kevin Grittner
Kirk Wythers wrote: > I hace a fairly large table with two columns that I need to > "de-normalize" (235 million rows) There has got to be a better > (i.e. faster) approach than what I am doing. I am using a MAX > CASE on each of the 24 variables (column names variable and > value) that I want to

[GENERAL] big un stacking query - help save me from myself

2013-03-13 Thread Kirk Wythers
I hace a fairly large table with two columns that I need to "de-normalize" (235 million rows) There has got to be a better (i.e. faster) approach than what I am doing. I am using a MAX CASE on each of the 24 variables (column names variable and value) that I want to unstack. Any suggestions wou