clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1044301 fiddles created (9409 in the last week).

CREATE TABLE tbl (id int, node1 int, node2 int); INSERT INTO tbl VALUES (1, 111, 123), (2, 122, 124), (3, 111, 125), (4, 122, 111), (5, 124, 111), (6, 126, 111);
6 rows affected
 hidden batch(es)


SELECT node, count(*) AS node_count FROM tbl, LATERAL (VALUES (node1), (node2)) AS x(node) GROUP BY 1 HAVING count(*) > 1;
node node_count
122 2
111 5
124 2
 hidden batch(es)