Table results format - should I use crosstab? If so, how?

From: Jennifer Mackown <niftyshellsuit(at)outlook(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Table results format - should I use crosstab? If so, how?
Date: 2014-03-19 14:58:57
Message-ID: DUB115-W1332BA00C05AAEF44DA982FD57F0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I have a problem with getting a table to display in the way I want it to. It's one of those things that looks so simple I should be able to do it in 5 minutes, but I've been working on it all afternoon and I'm getting nowhere!!
What I have is the following:
Date Firstday Lastday2014/03/12 1 12014/03/18 1 02014/03/19 0 12014/03/21 1 1

And what I need to see is this:
Firstday Lastday2014/03/12 2013/03/122014/03/18 2013/03/192014/03/21 2013/03/21

Can anyone help?
Thanks,
Jennifer

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Johnston 2014-03-19 15:47:50 Re: Table results format - should I use crosstab? If so, how?
Previous Message Emi Lu 2014-03-18 17:41:07 Alter column with views depended on it without drop views