I have a table friends which has following structure Person1 | Person2
SELECT * FROM friends returns
('Person1', 'Person73')
('Person1', 'Person22')
('Person1', 'Person79')
('Person1', 'Person65')
('Person1', 'Person67')
('Person1', 'Person55')
('Person1', 'Person8')
...
I want to query friends and friends of friends per person, how a query for this would look like?
NOE4JS variant for this query I wrote looks like this
MATCH (n:Person)-[r*1..2]-> (m) WHERE n.id <> m.id RETURN n.id as n,m.id as m but I'm struggling to rewrite it in MYSQL.