Re: [HELP]How to Create Cross Table!!
Posted in 1999
Paul
Use a stored procedure to calculate the values for each month and return 0's in
the other months, or use a union, like so:
select sales, month, [null, ... 11 times] from table where month = "jan" andyear = 1999
union
select sales, null, month, [null, ... 10 times] from table where month = "feb"
and year = 1999
union...
select sales, [null,...11 times], month from table where month = "dec" and year= 1999;
HTH
Sujit
paul <paoching@panpi.com.tw> on 09/16/99 03:23:57 AM
Please respond to paul <paoching@panpi.com.tw>
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: Re: [HELP]How to Create Cross Table!!
Dear sir
I want to use one field's value as result's column!
original table:
Sales Year Month Money
query result:
Salse, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12
----------------------------------------------------------------------------
---
Paul 1 1 1
................................................................
Please Help, I have to finish this report tonight!
Robert Taylor <robertt@scotlegal.com> wrote in message
news:7rqfso$d22$1@uranium.btinternet.com...
> Sorry , I don't understand the question.
>
> paul <paoching@panpi.com.tw> wrote in message
> news:7rqaub$70s@netnews.hinet.net...
> > Dear all
> > What's the SQL syntax of Informix can I create cross table result!
> > Thanks in advance!
> >
> >
> >
>
>