title: Select rows with duplicate values in 2 columns
body: <p>This is my table:</p>
  
  <pre><code>CREATE TABLE [Test].[dbo].[MyTest]
  (
  [Id]    BIGINT NOT NULL,
  [FId]   BIGINT NOT NULL,
  [SId]   BIGINT NOT NULL
  );
  </code></pre>
  
  <p>And some data:</p>
  
  <pre><code>INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (1, 100, 11); 
  INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (2, 200, 12); 
  INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (3, 100, 21); 
  INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (4, 200, 22);
  INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (5, 300, 13); 
  INSERT INTO  [Test].[dbo].[MyTest] ([Id], [FId], [SId]) VALUES (6, 200, 12); 
  </code></pre>
  
  <p>So I need 2 select query, </p>
  
  <p>First Select FId, SId that like a distinct in both column so the result is:</p>
  
  <pre><code>100, 11
  200, 12
  100, 21
  200, 22
  300, 13
  </code></pre>
  
  <p>As you see the values of <code>200, 12</code> returned once.</p>
  
  <p>Second query is the Id's of that columns whose duplicated in both FId, SId So the result is:</p>
  
  <pre><code>2
  6
  </code></pre>
  
  <p>Does any one have any idea about it?</p>