pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Daniel Dunajsky <daniel@dunajsky.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to write an query to get this result?
Date: Fri, 2 May 2003 09:48:35 +0100
Message-ID: <200305020948.36607.dev@archonet.com> (raw)
In-Reply-To: <01be01c30f8e$d9cbf160$0300a8c0@akssk>
References: <01be01c30f8e$d9cbf160$0300a8c0@akssk>

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




view thread (2+ messages)

Message-ID: <200305020948.36607.dev@archonet.com>
Permalink:  ../200305020948.36607.dev@archonet.com/
Also on:    postgresql.org/message-id/200305020948.36607.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, daniel@dunajsky.com
  Subject: Re: How to write an query to get this result?
  In-Reply-To: <200305020948.36607.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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