Created
January 25, 2011 17:27
-
-
Save andreypopp/795262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql=# table b; | |
l │ r | |
───┼─── | |
a │ b | |
b │ e | |
e │ d | |
(3 rows) | |
Time: 0.188 ms | |
psql=# with recursive c as (select * from b union select b.l, c.r from b join c on c.l = b.r) table c; | |
l │ r | |
───┼─── | |
a │ b | |
b │ e | |
e │ d | |
a │ e | |
b │ d | |
a │ d | |
(6 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment