Re: Window ?
От | Gerardo Herzig |
---|---|
Тема | Re: Window ? |
Дата | |
Msg-id | 1734068522.267007.1528901471548.JavaMail.zimbra@fmed.uba.ar обсуждение исходный текст |
Ответ на | Window ? (Olivier Leprêtre <o.lepretre@gmail.com>) |
Список | pgsql-sql |
----- Mensaje original ----- > De: "Olivier Leprêtre" <o.lepretre@gmail.com> > Para: pgsql-sql@lists.postgresql.org > Enviados: Miércoles, 13 de Junio 2018 11:33:50 > Asunto: Window ? > Hi, > > > > I have a road segment table with a few attributes for each. For each > segment, I have a road index and a segment index something like : > > > > road seg colA > > 1 1 att1 > > 1 2 att2 > > 1 3 att3 > > 1 4 att4 > > 2 1 att5 > > 2 2 att6 > > > > I want to convert records into lines, > > > > 1 att1 att2 att3 att4 > > 2 att5 att6 ... > > Looks like a solution with "pivot": https://www.postgresql.org/docs/current/static/tablefunc.html Look for "crosstab" functions. HTH Gerardo
В списке pgsql-sql по дате отправления: