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. 1044276 fiddles created (9432 in the last week).

CREATE TABLE t1 (id int, node1 int, node2 int); INSERT INTO t1 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 ( SELECT id, node1 as node FROM t1 UNION SELECT id, node2 as node FROM t1 ) t2 GROUP BY node HAVING COUNT(*) > 1 ORDER BY node
node node_count
111 5
122 2
124 2
 hidden batch(es)