Select distinct pairs joining a table to itself in sql
问题 I have a table with two rows: IMDB_ID and Actor. I am trying to find the pairs of actors who co-stared in 3 or more movies. The pairs of names should be unique, meaning that ‘actor A, actor B’ and ‘actor B, actor A’ are the same pair, so only one of them should appear. Here's a few lines of the table, but not the whole thing: IMDB_ID ACTOR ---------- ----------- tt0111161 Tim Robbins tt0111161 Morgan Free tt0111161 Bob Gunton tt0111161 William Sad tt0111161 Clancy Brow tt0111161 Gil Bellows