pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to write an query to get this result?
2+ messages / 2 participants
[nested] [flat]
* How to write an query to get this result?
@ 2003-05-01 03:07 Daniel Dunajsky <daniel@dunajsky.com>
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Dunajsky @ 2003-05-01 03:07 UTC (permalink / raw)
To: pgsql-sql
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.
Please reply to daniel_katka@hotmail.com
Thank you very much.
Daniel
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to write an query to get this result?
@ 2003-05-02 08:48 Richard Huxton <dev@archonet.com>
parent: Daniel Dunajsky <daniel@dunajsky.com>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Huxton @ 2003-05-02 08:48 UTC (permalink / raw)
To: Daniel Dunajsky <daniel@dunajsky.com>; 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-05-02 08:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-01 03:07 How to write an query to get this result? Daniel Dunajsky <daniel@dunajsky.com>
2003-05-02 08:48 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox