How to delete duplicate records in all tables of the database

I would like to be able to delete all duplicate records in all the tables of the database. Many of the tables have LONG columns.
Thanks.

Hello
To delete duplicates from an individual table you can use a construct like:
DELETE FROM
    table_a del_tab
WHERE
    del_tab.ROWID <> (SELECT
                            MAX(dups_tab.ROWID)
                      FROM
                            table_a dups_tab
                      WHERE
                            dups_tab.col1 = del_tab.col1
                      AND
                            dups_tab.col2 = del_tab.col2
                      )You can then apply this to any table you want. The only differences will be the columns that you join on in the sub query. If you want to look for duplicated data in the long columns themselves, I'm pretty sure you're going to need to do some PL/SQL coding or maybe convert them to blobs or something.
HTH
David

Similar Messages

  • Delete a record from a table in a Database with Database Connectivity

    I can't find the function from the Database Connectivity library that allows me to delete a record from a table of the database. I tried to use DB Tools Free Object.vi function but this one deletes only the table created with a query.
    Thankyou

    I have used the sql query as described above and it works fine with access DB and the DB toolkit, the free object vi only deallocated a recordset's references this will noty alter the database since the record is a copy of the databases information.  The SQL delete function is very versatile and you should be able to delete records with no problem.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How to delete duplicate records in 10 G.

    how to delete duplicate records in 10 G.

    --Here is one way to do it using a second table 
    create table temp1
    (col1 char(1));
    --Table created.
    insert into temp1 (col1) values('A');
    insert into temp1 (col1) values('B');
    insert into temp1 (col1) values('B');
    --1 row created.
    --1 row created.
    --1 row created.
    create table temp2 as select distinct * from temp1;
    --Table created.
    --now you have a second table with no duplicates
    --truncate your old table
    truncate table temp1;
    --Table truncated.
    --and reload it with data from the new table
    insert into temp1 select * from temp2;
    --2 rows created.
    --then drop the temp2 table
    drop table temp2

  • How to delete a record from BSEG table

    Dear Experts,
    How to delete a record from BSEG table.
    If there possible to delete some records from transparent table ?
    Please help.
    Regards,
    Tan

    Hi,
    Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30.  But it is not advisable to delete records, coz the records may be dependent on many other tables.  If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
    Pls. assign points, if useful
    Regards,
    Sridevi

  • How do I duplicate or copy a table onto the same page?

    In Pages, how do I duplicate or copy a table onto the same page?

    option drag duplicates anything or copy and paste
    Peter

  • Newbie ques : How to get the list of all tables in the database

    Hi,
    I'm very new to Oracle (using Oracle8i currently). I wanted to know if there is a way to get the list of all tables in the database. Like in mySQL you can use the command " show tables" to get the list of all the tables.
    Any help will e greatly appreciated. Please "cc" any reply to [email protected] also.
    thanks
    Deven

    Hi
    Select table_name, owner from all_tables;
    will give u all the tables in the database.
    all_tables, dba_tables, user_tables
    all_objects, dba_objects, dba_objects
    there are many, more tables. login as system and query the tab and try to describe the tables.
    Thanks
    Malar

  • How to delete duplicate rows in a table

    hai,
    i have a table which consists of hunderds of records and contains duplicate records also. how can i delete duplicate records.
    thanks
    ravi

    This maybe a litle bit fast for deletion:-
    delete from emp where rowid in (
    2 SELECT rowid FROM emp
    3 group by rowid,empno,ename,job
    4 minus
    5 SELECT min(rowid) FROM emp
    6 group by empno,ename,job);

  • How do I run sp_spaceused for all tables in a database?

    Hi,
    I am struggling to understand how to run the sp_spaceused sproc for all tables in a database.
    I know how to use it for one table but how would I replicate it automatically for each table in a given database?
    Regards,
    Ian.

    I just managed to alter the code of VidyaSagar and have pulled out all the information including Schema name. Below is what it looks like:
    set
    nocount
    on
    select
    'Database Name: ',
    db_name
    if
    exists(select
    name from tempdb..sysobjects
    where name='##tmp'
    drop
    table ##tmp
    create
    table ##tmp(TABLE_SCHEMA
    nvarchar(256),TABLE_NAME
    nvarchar(256),
    num_rows int,
    reserved_KB varchar(15),data_KB
    varchar(15),index_KB
    varchar(15),unsed_KB
    varchar(15
    go
    declare
    @tbl_schema nvarchar(256
    declare
    @tbl_name nvarchar(256
    declare
    @schema_tbl_name nvarchar(256
    declare
    tblname CURSOR
    for
    select
    TABLE_SCHEMA
    TABLE_NAME
    from
    INFORMATION_SCHEMA.TABLES
    where TABLE_TYPE='BASE
    TABLE' 
    open
    tblname
    Fetch
    next
    from tblname
    INTO @tbl_schema,@tbl_name
    WHILE
    @@FETCH_STATUS
    = 0
    BEGIN
    set @schema_tbl_name=@tbl_schema+'.'+@tbl_name
    insert
    into ##tmp(TABLE_NAME
    , num_rows
    , reserved_KB
    ,data_KB
    ,index_KB
    ,unsed_KB
    exec
    sp_spaceused
    @schema_tbl_name
    update ##tmp
    set TABLE_SCHEMA
    =@tbl_schema
    where TABLE_SCHEMA
    is
    NULL
    and TABLE_NAME=@tbl_name
    FETCH
    NEXT
    FROM tblname
    INTO @tbl_schema,@tbl_name 
    END
    CLOSE
    tblname
    deallocate
    tblname
    go
    select
    from
    ##tmp
    drop
    table ##tmp
    Warm Regards, Ajay

  • Table to get the list of all tables in the database

    hi,
    please let me knwo the table where i can get the list of all tables in the database

    hi,
    please let me knwo the table where i can get the list
    of all tables in the databaseHi Michael,
    Will you EVER start reading some documentation?
    I guess it's not far that many regulars won't reply to those kind of questions.
    Believe me, reading doesn't hurt (well, at least, most of the times).
    Rgds,
    Guido

  • How to Delete duplicate Records in Table

    CREATE GLOBAL TEMPORARY TABLE MyTable1 (
    Name1 varchar2(100)
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('12');
    insert into MyTable1 values ('12');
    select * from MyTable1
    I want to delete duplicate names from MyTable1..And after delete I should have 11 and 22 only.

    I got the answer
    delete from MyTable1
    where rowid not in
    (select max(rowid)
    from MyTable1
    group by Name1
    having count(1) > 1
    )

  • How to delete Duplicate records from the informatica target using mapping?

    Hi, I have a scenario like below: In my mapping I have a source, which may containg unique records or duplicate records. Source and target are different tables. I have a target in my mapping which contains duplicate records. Using Mapping I have to delete the duplicate records in the target table. Target table does not contain any surrogate key. We can use target table as a look up table, but target table cannot be used as source in the mapping. We cannot use post SQL.

    Hi All, I have multiple flat files which i need to load in a single table.I did that using indirect option at session level.But need to dig out on how to populate substring of header in name column in target table. i have two columns Id and Name. in all input file I have only one column 'id' with header like H|ABCD|Date. I need to populate target like below example. File 1                                    File2     H|ABCD|Date.                      H|EFGH|Date.1                                            42                                            5  3                                            6 Target tale: Id    Name1     ABCD2     ABCD3     ABCD4     EFGH5     EFGH6     EFGH can anyone help on what should be the logic to get this data in a table in informatica.

  • How to delete Duplicate records in IT2006

    Dear Experts
    We have a situation like where we have duplicate records with same start and end dates in IT2006. This is because of the incorrect configuration which we have corrected now, but we need to do  a clean-up for the existing duplicate records. Any idea on how to clean it?  I ran report RPTKOK00 to find these duplicates but I could not delete the duplicate/inconsistenct record using report RPTBPC10 or HNZUPTC0, i Could only delete the deductions happened in the record.
    Is there any standard report/any other means of deleting the duplicate records created in IT2006?
    Thanks in advance for all your help.
    Regards
    Vignesh.

    You could probably use se16n to identify the duplicates and create the list of quotas to delete, and you could probably use t-code lsmw to write up a script to delete them, but be aware that you can't delete a Quota if it's been deducted from.
    You'd have to delete the Absence/Attendance first, then delete the Quota, then recreate the Absence/Attendance.

  • How to delete duplicate records in cube

    Hi,
    can u help me how to delete the duplicate records in my cube
    and tell me some predifined cubes and data sourcess for MM and SD modules

    Hi Anne,
    about "duplicate records" could you be more precise?.
    The must be at least one different Characteristic to distinguish one record from the other (at least Request ID). In order to delete Data from InfoCubes (selectively) use ABAP Report RSDRD_DELETE_FACTS (be carefull it does not request any confirmation as in RSA1 ...).
    About MM and SD Cubes see RSA1 -> Business Content -> InfoProvider by InfoAreas. See also for MetadataRepository about the same InfoProviders.
    About DataSources just execute TCode LBWE in you source sys: there you see all LO-Cockipt Extrators.
    Hope it helps (and if so remember reward points)
    GFV

  • How to delete duplicate record in Query report

    Hi Experts,
    I had created an infoset and query in my sap, but I want to delete some duplicate records before the list out put.Please can we add some further codes in the Extras code to delete duplicates? And how do it? Would you please give me a simple brief.
    Joe

    Hi,
    You can try to restrict in the filter area in query designer with the values for characteristic which gives correct
    result.
    But still i would suggest that in the cube you keep not the duplicate records as this is not your requirement and giving
    you wrong result.
    So you can reload the correct records in the cube inorder to avoid such problems even in future.
    Regards,
    Amit

  • How to delete blank records in internal table

    Hi.
    please tell me how can i delete blank records in an internal table.
    thnx

    In that case
    Suppose you have 10 fields in internal table and if any of them is blank, you need to delete record.
    Try this command
    delete itab where field1 is initial or
                      field2 is initial or
                      field10 is initial.

Maybe you are looking for

  • How to create a table with data in it?

    I need to have a temp table in a PL/SQL procedure for processing which can hold data values from two other tables and a sequence number. Ex: Existing tables: table1 (col1 varchar2(100), col2 date, col3 number20) - Has more 1Lakh rows table2 (col1 var

  • Nano won't play songs and iTunes won't recognize it.

    After disconnecting my Generation 5 Nano from my clock radio yesterday, the nano would freeze every time I tried to play a song. Any song. I've tried about everything, with my goal now to just "restore" the nano. I reset it 25 or more times with sele

  • Outlook 2010 as a remote app with Remote Exchnage

    Hello All I am running RDS Farm with Windows Server 2008 R2. I have 2 RDS servers connected to domain and so on. I have managed to "publish" Internet Explorer as a remote app (For secure surfing) and it works perfectly. Now I would like to publish Ou

  • Sound preloading doesn't work in Air for iOS?

    I have a set of  sounds preloaded using load() method in Sound class in my game and it works fine when testing on my pc(windows 7). But when I deployed the game to iPad2, it seems like Air is only loading the sound files when play() method is actuall

  • Filing structure for iPhoto?

    I just installed iPhoto 6 and noticed what appears to be two different filing systems that essentially doubles the size of the iPhoto storage. One set of folders looks like the ones in iPhoto 4, the other is labeled Originals, which are filed by roll