pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: daniel_katka@hotmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: How to write a sql query to get this result?
Date: Thu, 01 May 2003 08:40:00 +0200
Message-ID: <3EB0C140.7040700@klaster.net> (raw)
In-Reply-To: <020601c30f92$22174ca0$0300a8c0@akssk>
References: <020601c30f92$22174ca0$0300a8c0@akssk>

Dnia 2003-05-01 05:31, Uz.ytkownik Daniel napisa?:
> 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
Find samething about contrib/tablefunc
This problem is well known as cross tab (pivot table).

Regards,
Tomasz Myrta




view thread (3+ messages)  latest in thread

Message-ID: <3EB0C140.7040700@klaster.net>
Permalink:  ../3EB0C140.7040700@klaster.net/
Also on:    postgresql.org/message-id/3EB0C140.7040700@klaster.net

 · 

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: jasiek@klaster.net, daniel_katka@hotmail.com
  Subject: Re: How to write a sql query to get this result?
  In-Reply-To: <3EB0C140.7040700@klaster.net>

* 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