Pergunta de entrevista da empresa Meta

(SQL) Given a table, provide all the pairwise combinations of IDs, without any duplicates. So with record1: ID1 ID2; record2: ID2 ID1; record1 or record2 needs to be removed.