Skip to content

Instantly share code, notes, and snippets.

View BorisKotlyarov's full-sized avatar
:octocat:

Boris Kotlyarov BorisKotlyarov

:octocat:
View GitHub Profile
@BorisKotlyarov
BorisKotlyarov / postgresql_recursive.sql
Created October 23, 2019 10:21 — forked from dankrause/postgresql_recursive.sql
An example of creating a recursive postgresql query to generate data about parent-child relationships within a single table.
CREATE TABLE test
(
id INTEGER,
parent INTEGER
);
INSERT INTO test (id, parent) VALUES
(1, NULL),
(2, 1),