[postgis-users] Create mutliple rows from a field

Olivier Leprêtre o.lepretre at gmail.com
Thu May 18 10:05:39 PDT 2017



I have a table with 2 columns : id, x (x is an int from 0 to n)


Is it possible to create a query that will return x ranked rows for each id




id       x

A        2

B        3

C        1

D       4


will return


A        1

A        2

B        1

B        2

B        3

C        1

D       1

D       2

D       3

D       4


I searched with OVER, PARTITION, RANK... without success






L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170518/397de3ce/attachment.html>

More information about the postgis-users mailing list