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

Поиск
Список
Период
Сортировка
От Jennifer Mackown
Тема Table results format - should I use crosstab? If so, how?
Дата
Msg-id DUB115-W1332BA00C05AAEF44DA982FD57F0@phx.gbl
обсуждение исходный текст
Ответы Re: Table results format - should I use crosstab? If so, how?  (David Johnston <polobo@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Emi Lu
Дата:
Сообщение: Alter column with views depended on it without drop views
Следующее
От: David Johnston
Дата:
Сообщение: Re: Table results format - should I use crosstab? If so, how?