Table results format - should I use crosstab? If so, how? - Mailing list pgsql-sql

From Jennifer Mackown
Subject Table results format - should I use crosstab? If so, how?
Date
Msg-id DUB115-W1332BA00C05AAEF44DA982FD57F0@phx.gbl
Whole thread Raw
Responses Re: Table results format - should I use crosstab? If so, how?  (David Johnston <polobo@yahoo.com>)
List 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    Lastday
2014/03/12        1                1
2014/03/18        1                0
2014/03/19        0                1
2014/03/21        1                1


And what I need to see is this:

Firstday             Lastday
2014/03/12       2013/03/12
2014/03/18       2013/03/19
2014/03/21       2013/03/21



Can anyone help?

Thanks, 

Jennifer 

pgsql-sql by date:

Previous
From: Emi Lu
Date:
Subject: Alter column with views depended on it without drop views
Next
From: David Johnston
Date:
Subject: Re: Table results format - should I use crosstab? If so, how?