title: Find duplicates in table 2 and return back the record based on the id
body: <p>I am trying to make a query to remove the record in table 1 based on the duplicate records found in table 2. id is the common link between these two tables. The Database is oracle. I am new in writing up queries and the below is the query i came up with so far which is not working out. Can anyone please suggest?</p>
  
  <p>I am actually trying to delete record based on the id in table 1 on a condition when there are duplicate records in table 2 for that id as well as one more column? Below is the error message i am getting, am really not sure if query is accurate either or need to re write the whole query itself?</p>
  
  <p>"invalid sql statement" - ORA-00900</p>
  
  <pre><code>    DELETE TABLE AS m WHERE m.id IN 
     (SELECT id from table2 t WHERE ROWID &gt; 
  (SELECT MIN(ROWID) FROM table2 r WHERE t.column2 = r.column2);
  </code></pre>