remove the second record of strings

Hi all

I have the table emp with the id and name columns.

EMP

name identity
--------------------
100A
100a < -.
101 B
102 C
102 c <.
102 C

now I want to delete duplicate lines second of each group of duplicate rows.

Can be
The OP wants to delete 2nd record ;)

create table test2
as
select 100 col1, 'A' col2 from dual union all
select 100, 'A' from dual union all
select 101, 'B' from dual union all
select 102, 'C' from dual union all
select 102, 'C'  from dual union all
select 102 ,'C' from dual 

delete from test2 t2
where rowid in(select rowid from(
select col1,col2,row_number()over(partition by col1 order by col2) rn
from test2) where rn=2)

2 rows deleted 

select * from test2

COL1      COL
100      A
101      B
102      C
102      C

Tags: Database

Similar Questions

  • Remove the second y-axis Via COde

    Hello

    I want to remove the second axis of my report through the code model. Because for one report, I need 2 axis y. for the other report, I don't need a single axis, so I want to remove the second axis.

    I tried GraphObjDelete order, it did not work.

    Help, please.

    Thank you

    Sunil Padikar M

    Hello

    Here is the script code:

    Dim o2DAxisYList
    Set o2DAxisYList = Report.Sheets ("Page 1"). Objects ("2DAxis1"). YAxisList
    MsgBox o2DAxisYList.Count
    If o2DAxisYList.Count > 1 then
    o2DAxisYList.Remove (2)
    end if
    MsgBox o2DAxisYList.Count

    Greetings

    Walter

  • Lightroom keeps trying to create a second folder "2016" under "2016", then of subfolders, why and how do I remove the second folder "2016".

    Lightroom keeps trying to create a second folder "2016" under "2016", then the subfolders with the correct name (date) at import, why and how can I remove the second folder "2016".

    One of the possibilities: when you import, you select a Destination folder that contains a subfolder of 2016 in the path (displayed in the green rectangle) when you really want a destination folder that does not have the 2016 subfolder in the path (shown in the red rectangle)

  • How to remove the second Fusion VM VMware VMDK

    OK, this should be a simple question, but I do not see the answer anywhere.

    I have a virtual machine with two virtual hard disks: a 100 GB C: drive and a D: 400GO drive. I have drive D: more, because the data it contained has been displaced elsewhere. I shut down the virtual machine and use the parameters dialog box to remove the second hard drive. But my whole VM is still huge, as the VMDK for D: drive is always there. I don't want to narrow it down, I just want that he went.

    How can I remove it? Shouldn't be able to change all references to this second VMDK from the VMX file, and then drag the second VMDK of packaging of the virtual machine and in the trash?

    Thanks for any help.

    Clayj wrote:

    How can I remove it? Shouldn't be able to change all references to this second VMDK from the VMX file, and then drag the second VMDK of packaging of the virtual machine and in the trash?

    When you delete a virtual hard disk in the Virtual Machine settings, it's just changes a value in the from true to FALSE .vmx file but does not delete the files that make up the disc or a hard file.

    You can therefore remove in the settings or manually edit the .vmx file and the button Delete the appropriate hard.

    Note: Make sure that you remove the right files!

  • remove the last record from the plsql table

    TYPE r_LOOPElement IS RECORD (TermID   NUMBER 
                                          );
    
    TYPE t_LOOPType IS TABLE OF r_LOOPElement INDEX BY BINARY_INTEGER;
    i_CustomerLoop      t_LOOPType ;
    
    i_CustomerLoop(1).TermID=1;
    i_CustomerLoop(2).TermID=2;
    i_CustomerLoop(3).TermID=3;
    Under certain conditions, I need to remove the last record from i_CustomerLoop

    whichi s the best way to do it. because I sometimes get duplicates for TermID in this plsql table.

    Hello

    See [removing items from Collection (DELETE method) | http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/collections.htm#CJAFGFIG]

    Kind regards

  • Equium A200-1AC - cannot remove the second HARD drive cover

    I have an Equium A200-1AC, there is also a second HARD-drive Bay, but I can't get the cover off the coast, can anyone help?

    Hello

    As far as I know, this HARD drive cover is only guaranteed with a screw and after the withdrawal of these screws, you should be able to remove the plastic cover.
    Maybe it's sticks somewhere, you can use a thin object and could leverage with caution
    But don t do something with force!

  • Remove the unused characters from string

    Hi, I try to remove unused characters from a string, but I can't find a function for this.

    The string like: 0000 0000 0000 0000 0000 0000 0130 3130 3030 3030 3004 0000 0000 0000 0000 0000 0000 0000, I need the characters from 01 to 04.

    I need some advice.

    If the characters between the SOH and EOT had a NULL value, then Match Regular Expression can be a choice:

    Find \x01, find something else THAN \x04, then find \x04

  • Cannot remove the two records at once in a table

    Hi all

    I have a version in the form of table, here I have a point of delete button where them remove those audited point tabular presentation.  If I have checked for two records continuously one after the other and press the button Delete, remove only the first record I checked only. Whereas, if I chose two records where both of them is not one after the other. Both will get supprim├⌐s.

    Start

    GO_BLOCK ('ACT_QT_TXN');

    PREMIER_ENREGISTREMENT;

    LOOP

    IF: ACT_QT_TXN. CHECK_BOX256 = 1 THEN

    delete_record;

    COMMIT_FORM;

    END IF;

    NEXT_RECORD;

    IF (: System.Last_Record = "TRUE") and: ACT_QT_TXN. CHECK_BOX256 = 1 THEN

    DELETE_RECORD;

    COMMIT_FORM;

    EXIT;

    ON THE OTHER

    IF (: System.Last_Record = 'TRUE') THEN

    EXIT;

    END IF;

    END IF;

    END LOOP;

    PREMIER_ENREGISTREMENT;

    execute_query (no_validate);

    end;

    Something wrong with my script above? Please help me. Thanks /.

    Kind regards

    Lim

    The problem is with Commit_form after every single deletion. What karim gave is smooth, but I like it this way-

    PREMIER_ENREGISTREMENT;

    DECLARE

    BEGIN
    LOOP

    WHEN THE OUTPUT: SYSTEM. RECORD_STATUS = "NEW";

    If: CHECK_BOX = 'Y' then

    delete_record;
    end if;
    NEXT_RECORD;

    END LOOP;

    COMMIT;

    PREMIER_ENREGISTREMENT;

    execute_query (no_validate);

    END;

    Concerning

    Bobin

  • Remove the schema from a string

    Hello

    I was wondering if there is any better way to do something like that?
    SELECT 
        REPLACE( 
          REPLACE( 
            REPLACE(
              'SOMETHING .A .B .C Something else !', '.A',''),
            '.B', '' ),
          '.C', ''
        )
    FROM DUAL;
    This is just one example. My real case is a little more complex. So I would remove the. A. B. C. now I use REPLACE followed by the template should be deleted and I put an empty string as a replacement string. And it does the job properly. But I was wondering if there is another way that can avoid me using 3 Replace.

    Thanks for your help,

    user13117585 wrote:
    Me being stupid again...

    Sorry for this stupid question.

    SELECT
    TRANSLATE('SOMETHING .A .B .C Something else !', ' .A.B.C',' ')
    FROM DUAL;
    

    Not a stupid question at all. Assuming that you want only to remove the actual strings. A. B and. C, so it is actually more difficult than it sounds. Consdier:

    SQL> SELECT TRANSLATE(x, ' .A.B.C',' ') xlate,
      2         REGEXP_REPLACE(x, '(\.A)|(\.B)|(\.C)') rexp
      3  FROM (SELECT 'SOMETHING .A .B .C Something else !' x
      4        FROM DUAL
      5        UNION ALL
      6        SELECT 'SAMETHING .A .B .C Another Bit !'
      7        FROM DUAL);
    
    XLATE                               REXP
    ----------------------------------- -----------------------------------
    SOMETHING    Something else !       SOMETHING    Something else !
    SMETHING    nother it !             SAMETHING    Another Bit !
    

    John

    Published by: John Spencer, March 8, 2011 09:10
    ADED the SQL instead of just the results

  • How we remove the old recording files in ES2?

    Hello

    The error:

    2010-02-26 16:25:16, 811 ERROR [STDERR] 26 February 2010 16:25:16 com.adobe.idp.auditworkflow.dsc.service.storage.ProcessRecordingStorageImpl manageRecordingFileSizes
    ATTENTION: removal or the older recordings due to the limitation of space.

    I see above error several times in the log file. Then google, I had http://forums.adobe.com/thread/506674?tstart=0 wire. But I know this one.

    Is there any page in /AdminUI, where I can remove all the old record to a shot.

    Is there a way where I can improve the size of the buffer to the server?   Because sometimes I am getting error like below:

    2010-02-26 16:12:12, exceeding the threshold of memory WARN [com.adobe.idp.dsc.workmanager.workload.policy.MemoryPolicy] 558: maximum limit of 95.0, current value 106.0
    2010-02-26 16:12:12, 559 WARN [com.adobe.idp.dsc.workmanager.workload.policy.WorkPolicyEvaluationBackgroundTask] policies being violated since statistics on "adobejb_server1:wm_default". Cause: com.adobe.idp.dsc.workmanager.workload.policy.WorkPolicyViolationException: political work violated. Will try to get to 60000 ms

    Please help me!

    This is the help topic:

    http://help.Adobe.com/en_US/LiveCycle/9.0/workbenchHelp/000375.html#1548929

    Here's how to configure the number of recordings to keep:

    http://help.Adobe.com/en_US/LiveCycle/9.0/workbenchHelp/001482.html#1608026

    Scott

  • Remove the HTML from a string

    I have some data which are recorded by a rich text editor, but I need to display it in a datagrid without HTML tags.

    Someone at - it a regular expression for the elimination of all of the HTML in a string?

    Y at - it another way to do this in flex.

    Thank you

    Nevermind I found it. In case anyone is interested.

    [var myPattern: RegExp = /<[^>] * > / g
    txt = txt.replace(myPattern,"")

  • Try the seizure record - but (String) row.getAttribute getting no value

    Hello

    I am trying to get into the new record.
    I took messagetext entries where the user can provide value.
    I'm using (String) row.getAttribute to retrieve the value entered by the user.

    But offer when you click on the button - it does not enter the value (although he shows is entered successfully)

    I tried to investigate and printed the value that is retrieved (String) using row.getAttribute and surprisingly, I noticed it's NULL value recovery.

    What was wrong?

    Thanks in advance.

    Hello

    Try with the following:

    1 > string IBO = pageContext.getParameter("IBOTextInputField");
    2 > keep AM = Y, while clicking on the submit button.

    Thank you
    Kumar

  • doubt everything by removing the child records

    Hi people,
    I have a table with following structured Teg.

    SQL > DESC TEG
    Name Null? Type
    ----------------------------------------------------- -------- ---------------
    A NON NULL NUMBER (38)
    B NUMBER (38)
    C NUMBER (38)


    where A column is the primary key column and column B is foreign key
    According to column A column.


    SQL > select * from teg.

    A, B AND C
    ---------- ---------- ----------
    10 10 30
    20 10 40
    30-20-90

    now, these are the data present in this table.now I want to delete a recording of teg, where A = 10.but I couldn't do because I have child records according to values.so primary key, I decided to delete records by using the statement.

    SQL > delete from the teg where b = 10;
    Remove from the teg where a = 10
    *
    ERROR on line 1:
    ORA-02292: integrity constraint (VID. TEGFK) violated - book of the foundling

    but throws with this error.then I tried to remove another
    Save the Declaration,

    SQL > delete from the teg where b = 20;

    1 line removal.

    but I got that last removed the table.why file I couldn't remove data using State 'WHERE B = 10'.but able to delete the record
    with "WHERE even if the parent record is A found.pls = 20' help me."


    Concerning
    VIDS

    vidusnat wrote:
    SQL > SELECT * FROM TEG.

    A, B AND C
    ---------- ---------- ----------
    10 10 30
    20 10 40
    30-20-90

    as I could delete record of TEG by issuing,

    REMOVE FROM THE TEG WHERE B = 20;

    Yes, this means that you remove a record of a value in column A of 30 (for B = 20) - there is no trace of the child who refers to this record with a value in column A of 30, so you can REMOVE that record without problem.

    vidusnat wrote:

    But why I couldn't delete records to aid,

    REMOVE FROM THE TEG WHERE A = 10;

    10 and 20 are present in the primary key column A.but why am not able to delete the address of the child column B.I don't know no other integrity constraints have been create except between column A and B.pls suggest me.

    There must be a record in the referencing table that has a foreign key value 10 - don't forget on the deletion of a record of the child in column B, you can delete an entire record, not a partial record. The table that references must be another table, it is not another column in the same table -it does not work like that. A foreign key between tables , not within the same table.

    Run this code, and you'll see what other table of the foreign key means:

    SELECT table_name
       FROM ALL_CONSTRAINTS
     WHERE CONSTRAINT_NAME  = 'TEGFK'
    

    That will tell you the other table that has a foreign_key associated with your table TEG.

  • Portege 3490CT: clock stops and how to remove the second operating system?

    I recently bought a 3490CT that has a few probs.
    (1) the continuous clock to stop--has a separate battery? It has an impact on things like sending emails, which are always evil dated/timed. You can set an hour latter, it stops again.

    (2) it came with 2 operating systems, Wind98 and Win2000... you get a choice at startup, how do I remove the old?

    (3) what updates are available to make it faster - playing DVDs on the "plug in the drive" is slow and jerky...

    Thanks to all, any info appreciated.

    Which one do you mean? The clock of the OS?
    Check in the BIOS if the time and data are correct.
    Eventually, you use settings area of bad weather and time of the laptop is going to be permanent synchronize with internet time server. This option that you can find in the Date and time properties

  • How can I remove the compositions recorded in the Mix?

    I would like to delete saved images in my library of Photoshop Mix.  can someone please tell Mr the way to do this?

    There is a small bin in the lower right corner of each project (in the view of the gallery). Click on it will remove the project.

Maybe you are looking for

  • will not process an order for photo book

    I tried to buy a book picture for the LAST 3 days and get the message, available software update not try again later. Why this is happening for so long?

  • Satellite A100 - looking for a BIOS update

    I have the problem of my laptop: the screen goes black and the pc restarts Suggest you solution and problem BIOS update reports on the technical page of toshiba supprt. When I get my satellite A100-036 give me the error page not found the page you re

  • NOR-6289 DAQ latency for the generation of digital signals

    What I want to achieve is less than 1 second latency between the update of several digital waveforms and see these values appear on the digital output pins.  For example if I have 16 digital output channels in my task and I am writing 127 samples for

  • Documents to go does not work after update of market

    I know that this has been discussed a bit here and here. But I thought that he deservs its own thread. You see, there is an updated release of the Documents to go on the market. Obviosly I tried to upgrade to this latest version. My Documents to go n

  • Capricious monitor problem

    My monitor does not work unless I unplug it and a plug, I have Windows Vista. Vista load upward (I hear it in the background!) but I have a black screen.  Then I have to unplug the monitor, plug it in again and it manifests as usual.  This problem st