Skip to content

Instantly share code, notes, and snippets.

View NamTang's full-sized avatar

Tang Hoai Nam NamTang

  • Ho Chi Minh, Viet Nam
View GitHub Profile
@dankrause
dankrause / postgresql_recursive.sql
Last active March 6, 2025 20:15
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),