From: | "maria s" <psmg01(at)gmail(dot)com> |
---|---|
To: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
Cc: | "Osvaldo Rosario Kussama" <osvaldo(dot)kussama(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: help in writing query |
Date: | 2008-06-10 19:51:50 |
Message-ID: | d9d42a0f0806101251j79812d87hea0ae13867d4a0b5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi Scott,
Thanks for the information. This is very useful for me.
I will be careful when forming the column.
Thanks,
-maria
On Tue, Jun 10, 2008 at 3:16 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
wrote:
> On Tue, Jun 10, 2008 at 11:51 AM, maria s <psmg01(at)gmail(dot)com> wrote:
> > Hi Rosario,
> > Thanks for the link. I hope this will solve my problem.
>
> It should be able to. Note that crosstab functions expect "square"
> inputs from the select they run. I.e. you can't have empty columns,
> you need to replace NULL output with something like a space or empty
> string.
>
> This is bad input for crosstab:
>
> col1 col2 col3
> 1 2 3
> 2 3 NULL
> 3 NULL 6
>
> But this will work:
>
> col1 col2 col3
> 1 2 3
> 2 3 '' <- an empty string
> 3 '' 6
>
> The crosstab functions are wonderfully useful btw, once you figure all
> the little quirks like this out.
>
From | Date | Subject | |
---|---|---|---|
Next Message | Medi Montaseri | 2008-06-10 20:11:23 | Re: Conceptual Design Question |
Previous Message | Scott Marlowe | 2008-06-10 19:16:29 | Re: help in writing query |