title: fetching duplicate tuples in Oracle using SQL
body: <p>Here are the two table structures<a href="https://i.stack.imgur.com/CCHG3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CCHG3.png" alt="Table 1"></a><a href="https://i.stack.imgur.com/h3bDo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h3bDo.png" alt="Table 2"></a></p>
  
  <p>I have two tables where I am trying to fetch some duplicate records based on some condition like <code>where a.fname=b.fname and a.phone_no&lt;&gt;b.phone_no</code>  </p>
  
  <p>But also I need to include other column 'address' which is in table 2 and introduce the same condition for duplicate checking for address as well.</p>
  
  <pre><code>SELECT 
   "Fname"||' '||"Lname" AS "Customer_Name",
    COUNT(*) AS "Countof" 
  FROM "S_CONTACT" A 
  WHERE EXISTS (
    SELECT 1 
    FROM "S_CONTACT" B 
    WHERE A."PHONE" != B."PHONE" 
      AND A."Fname" = B."Fname" 
      AND A."EMAIL"=B."EMAIL" 
      AND A."Lname"=B."Lname" 
      AND "DOB" IS NULL
  ) 
  GROUP BY "Fname","Lname","EMAIL" 
  HAVING count(*) &gt;1; 
  </code></pre>
  
  <p>The above sql gives me a list of customers with duplicate names and email.<br>
  But I do not know how to introduce the column address in this sql which is from different table t2</p>