View Single Post

   
  #3 (permalink)  
Old 04-20-2008, 11:05 AM
Konikoff, Rob \(Contractor\)
 
Posts: n/a
Default RE: cross tab needs in SQL


> On 1/5/06, Konikoff, Rob (Contractor) <rob.konikoff@us.army.mil> wrote:
> > INFORMIX-OnLine Version 7.23.UC11
> > ISQL-7.20.UD1
> > HP-UX 11.0
> >
> > Is there a way to do a cross tab output in ISQL?
> > What I need:
> > ID|1 Day|4 Day |20 Day|25 Day|
> > 01| 25 | 20 | | |

> - What is not clear to me is whether the columns are fixed at
>
> They are dynamic...


Serge Wrote:

PIVOT:
SELECT Year,
MAX(CASE WHEN Quarter = 1
THEN Results END) AS Q1,

[delete]

UNPIVOT:
SELECT Year, Quarter, Results
FROM SalesAgg AS S,

[delete]

Cheers
Serge
--

Serge:

Does PIVOT and UNPIVOT work in ISQL 7.2? Rob

Reply With Quote