Re: How to write an query to get this result? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: How to write an query to get this result?
Date
Msg-id 200305020948.36607.dev@archonet.com
Whole thread Raw
In response to How to write an query to get this result?  ("Daniel Dunajsky" <daniel@dunajsky.com>)
List pgsql-sql
On Thursday 01 May 2003 4:07 am, Daniel Dunajsky wrote:
> Hello,
>
> Is there any way how to retrieve result normally displayed as:
>
> TOTAL             268
> Administrator     7
> Internet Only      178
> Filtered Internet  7
>
> To be like this:
>
> TOTAL Administrator Internet Only Filtered Internet
> 268        7                   178               7
>
> That means, the rows of the first column of the first case are headers in
> the second case. Similarly, the rows of the second column are displayed as
> one row.

There are some crosstab-style functions in the contrib directory in source.
Can't remember where, sorry. Look for something like "cross-tab" or try the
table-function examples.

--  Richard Huxton



pgsql-sql by date:

Previous
From: "Yudha [ Inas_Husband ] Setiawan"
Date:
Subject: It's About field type array
Next
From: Rado Petrik
Date:
Subject: Problem with old relation