Medium - Q6

 avatar
unknown
sql
4 years ago
247 B
5
Indexable
select f.X, f.Y from Functions f where f.Y > f.X and (select count(*) from Functions where X = f.Y and Y = f.X)>=1 union select f.X, f.Y from Functions f where f.X = f.Y and (SELECT COUNT(*) from Functions where X = f.X and Y = f.Y)>=2 order by X;
Editor is loading...