Re: rotate psql output

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Ben Carbery <ben(dot)carbery(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: rotate psql output
Date: 2010-09-30 11:33:38
Message-ID: 4CA47592.4000609@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30/09/2010 12:17, Ben Carbery wrote:
> I have a query that returns many columns but few rows. I would like to
> display output horizontally instead of vertically, i.e. rotating by 90
> degress, so column headings appear in the left margin, and the output is
> not 'wrapped'.
> Is this possible? I have had no luck searching for this as rotate
> usually means log rotation.

Googling on "sql swap rows columns" found this:

http://stackoverflow.com/questions/584232/t-sql-how-to-swap-rows-and-columns

...which you'll be able to adapt.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2010-09-30 11:36:55 Re: rotate psql output
Previous Message Vincenzo Romano 2010-09-30 11:31:40 Re: rotate psql output