db Select Rows Where Value from One Column Matches Other Column TL;DR: Use a JOIN. I've got a table representing a tree, using two columns: CREATE TABLE "EXAMPLE" ( "PROP_ID" VARCHAR2(20 BYTE) NOT NULL ENABLE, "PARENT_PROP_ID" VARCHAR2(20 BYTE) NOT NULL ENABLE, /* * Data ... */ "CLASS_ID" VARCHAR2(20