write a query to delete similar records in same table

Answer Posted / apurva

delete from <tablename> rowid not in (select max(rowid)
from <tablename> group by <col.name where there are
repeating records>);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of queries in sql?

513


Where the sql database files are stored?

477


- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

1378


What is the command used to fetch the first 5 characters of a string?

702


Do prepared statements prevent sql injection?

521






how many ways to get the current time? : Sql dba

520


what is transaction? : Sql dba

525


Why triggers are used?

549


What is the difference between sum and count in sql?

516


What is scalar and vector?

521


how to use in conditions? : Sql dba

503


what is the difference between rownum pseudo column and row_number() function? : Sql dba

608


What is the sql case statement?

566


What will you get by the cursor attribute sql%found?

532


what are the t string functions available in tsql? : Transact sql

533