I have created this SQL statment, used to pull the child/leaf nodes off of a
N-ary node structure in PostgreSQL.
Is my premise all wrong?
Is this efficent as a SQL select?
Should this be done in my code (something I try to avoid for abstraction
reasons)?
"SELECT DISTINCT t1.node_id FROM node t1 WHERE NOT EXISTS (SELECT
t1.node_id FROM node t2 WHERE t1.node_id = t2.parent_id);"