Remove identical lines of table

Hello
I use the apex of oracle 10g 3.2
I have a table like this t_results

RESULT_ID SERVICE_REGISTRATION_ID PARAMETER_ID RESULT
20160 61947 484 0.9
20161 61947 485 not measured
20149 61947 484 0.9
20151 61947 485 not measured
20133 61948 475 0.1
20155 61948 475 0.1
20156 61948 475 0.1

I want to remove identical lines like line 1 and line 3 are identical, too, tier 2 and tier 4.
So I want to remove a line which is identical, i.e. Remove line 1 or line 3.
There may be more then 2 identical rows.
First pass is the primary key.

I want to write one on load pl/sql block.

How to do this?

Thank you
DELETE FROM table_t
  WHERE ROWID IN(
       SELECT ROWID
         FROM (SELECT ROWID,
                      ROW_NUMBER() OVER(
                         PARTITION BY result_id, service_registration_id, parameter_id, RESULT
                         ORDER BY ROWID) AS r
                 FROM table_t)
        WHERE r > 1);

HTH, Urs

Tags: Database

Similar Questions

  • Remove a line of table with a button in Livecycle Designer SS3

    I have a table in Livecycle which includes 16 static lines. Several lines can be added or removed dynamically at the end of the table.

    I want the user to be able to remove one of the static lines if they want to however I can't get the script to work.

    I have a button at the end of the line with the script:

    driverTable._Row2.removeInstance (true);

    I tried various forms of this script such as do not use the abbreviation for 'instanceManager', leaving 'real' outside, etc. Where it says 'Row2' I would like to use this script for the following lines, Row3, etc. Row4.

    I tried with the initial counter value of 1 and tried to zero. The table is in a fluid subform.

    Can anyone help?

    Hello

    A line cannot be set to 0 cases, if you want to remove a line, you need to hide by using its property of presence...

    But if you use 1 table for 16 different ranks, why don't you set the table with dynamic lines and have an initial 16 meter, then you can delete the lines you want with the removeInstance method

  • How to remove newly added line in table advanced

    Hello

    It comes to 12.1.3.

    I have a case of use with advanced table and the "Add Row" button.

    The user can add two lines (empty), field 2 (both part of PK, the two LOVs), then start filling, then realizes he added too many, because the TooManyObjectsException exception is thrown. What would be the 'Nice' way of having the last added row deleted, or some newly added lines to delete if a few lines have been added (before actually trying to commit). I mean how must reference any row that has been added and should be removed - this line do always not PK (PK because not even adjustable due to violation of PK if this makes sense). Is there a fun/easier way to do it? Would be great if someone could share a line or two...

    Thank you

    Anatoliy

    PS

    I have a delete button in a footer with action to fire the event as 'remove' in LICS, I like below, and copy the following code deletes the LAST record in the advanced table, not the one where the cursor is?

    If ("delete".equals (pageContext.getParameter (EVENT_PARAM)))
    {
    String rowRef = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Line OARow = (OARow) am.findRowByRef (rowRef);
    Row.Remove ();
    }

    Asmirnov-Oracle wrote:

    Hello

    Yes, I actually try this approach too.

    Have what approach you tried? 1 or 2?

    If you try to follow the second approach, you can try this?

    OAViewObject srcAppvo = (OAViewObject)findViewObject("SrcAppVO1");
    if (srcAppvo != null) {
        RowSetIterator srcAppRowItr =
            srcAppvo.createRowSetIterator("srcAppRowItr");
    
        try {
            Row srcAppRow;
            srcAppRowItr.setRangeStart(0);
            srcAppRowItr.setRangeSize(srcAppvo.getFetchedRowCount());
            int recCnt = srcAppvo.getFetchedRowCount();
            while (srcAppRowItr.hasNext()) {
                srcAppRow =
                        srcAppRowItr.next();
                if (srcAppRow != null) {
                    if (srcAppRow.getAttribute("SelectFlag") != null &&
                        srcAppRow.getAttribute("SelectFlag").toString().equals("Y")) {
                        srcAppRow.remove();
                    }
                }
            }
        } finally {
            srcAppRowItr.closeRowSetIterator();
        }
    }
    
  • Remove empty lines in the merged table

    I'm looking for a script that will find and remove empty lines from a table that contains fields of fusion.

    I have a table of data with about 800 cases. This table is used to merge a page report which shows the various components of the employee's income. There are about 20 lines in the table and 5 columns. I apply the merge fields to a table in my .indd file and merging works perfectly. However, there are several features/components of income who share not all employees. Therefore, all pages of the 800-page report contains several blank lines should I have deleted so that the remaining data lines to snuggle up to each other.

    I need a script that will find blank lines in an .indd table and delete them. I found the script that did this and works perfectly on an ordinary table with blank lines. However, it seems that a table cell that contains a merge field (< < myField > >) is not necessarily 'empty', even if the data in this field is Null. I found that after the merger, I can highlight a blank line, press DELETE, run the script, and the line disappears, as needed. But it manually thousands of times would frustrate the purpose of the script. Also note that I've rubbed my data file to ensure that no hidden formulas, characters or spaces. The "Remove blank lines for empty fields" option does not work on the fields in the table (it seems to me. If I'm wrong, let me know).

    It seems that I really need script which will remove references to empty merge fields after the merger. I could run and then my other script.

    I have spent hours on this and hope someone can point me in the direction of a solution.

    Thank you!

    You can remove the markers of merge field by doing a search and replace of TEXT PLAIN for and replace it with nothing. That should allow your script to work.

  • How to remove a line empty without validation error in ADF Table (EMP)

    Hello world

    I use the EMP Table in page jspx ADF to insert data into database.when, I insert a line in the table by createInsert operation, it the insertion of the line. But I need to remove that line immediately with enter them any value.

    But it displays a validation to empno error. Y at - it means to remove the empty line? If not, what are the reasons that we cannot remove the line.

    could someone tell me why!

    Thanks in advance!


    Kind regards
    Amar

    Published by: 973755 on December 11, 2012 06:42

    Amar,

    I'm a bit confused with your logic here...

    But if you try to delete the row by clicking the button Delete you can set the immediate property to true, this function of deletion will take place without performing any validation of the entity...

    R

  • Remove a line from several tables

    Hello

    I have a form that has what appears to be a single table.  Given that I needed 30 column (29 of them are single character fields) I had to use 2 objects from the table.  Then I had the ability to add and delete lines.  Add a line at the end is pretty easy.  Deleting a specific line is the problem.  For now, I added a third table that has a header line and a line of item body.  the body line is a button with the intention to withdraw this entire line of the table.  In other words, need remove the line in all 3 tables.

    My structure is:

    • Form1
      • (Some other subform past who is not serious for us)
      • SubformPersonnel (a subform sank)
        • SubformHeader (a positioned subform)
          • TextOverallHeader (text to label the oeverall 3 tables)
          • ButtonAddRow (adds a line at the end of all 3 tables)
        • SubformPersonnelTable (a positioned subform)
          • ContractorTableRemove (a table with a 1 column for the button Delete)
            • HeaderRow (line hidden to align the table with the other 2)
            • Element (a line with the button Delete)
              • CellRemoveButton (the cell with the button Delete and associated JavaScript)
          • ContractorTableLeft (a table with the left 15 printed columns)
            • HeaderRow
            • Contractor (a row of data to be deleted when it is clicked on CellButton above)
          • ContractorTableRight (a table with the right 15 printed columns)
            • HeaderRow
            • Contractor (a row of data to be deleted when it is clicked on CellButton above)
      • (Some other subforms that I'm not worried at the moment)

    The 3 tables are aligned to the headers of all line up, no space between them.  Body lines line up then and it looks like a large table.  From left to right, they are:

    ContractorTableRemove, ContractorTableLeft, ContractorTableRight

    Point lines and contractor are added when you click on ButtonAddRow in the header of all.  The initial number is set to 8 for each table, so I get 8 rows at the start. The minimum number is set to 1 for each.  I know that each row in each table has the same index number, because I filled in a cell in each table cell initialize durig.  This line, in the click event of the CellRemoveButton removes the row of the cell in this table:

    This.parent.parent._item.removeInstance (this.parent.index);

    I tried all kinds of ways to remove the same line (using the index #) in the other 2 tables: ContractorTableLeft and ContractorTableRight, but do not seem to get the correct correct syntax.  I tried hard coding references, using .parent as shown below and also tried to use an index 1 just to try deleting a line with no result.

    this.parent.parent.parent.ContractorTableLeft._Contractor.removeInstance (this.parent.inde, x);

    Can someone get me the correct syntax here?

    For example put a button Delete hidden on each table, click on that I saw, but I'm afraid it will get in the tables on each side of the table, in that it is the trail.  I reeally want just to refer to the line and remove it if I can avoid all these problems of further removal can cause problems.

    I copied the form to https://Acrobat.com/#d=7M8R50rEHf4AaVXppwyKLw

    Hi Karl,

    Here is your form you: https://acrobat.com/#d=oRRJP3W * OgBk6DqXXbJhgg.

    I've corrected the Add button, the button Delete and remove the button at the top. I annotated the script, so I hope you can follow.

    Hope that helps,

    Niall

  • How to remove a line duplicate a table

    Hello

    I have two lines in a table of data same as duplicate. I want to remove a line from that.

    When I try, it was remove the two lines of the same data.

    Thank you

    Remove the table table_name
    where (rowid, column_name)
    not in
    (select min (rowid), column_name column_name PGE group)

    ex:

    Delete from emp
    Where (ROWID, empno)
    not in
    (select min (rowid), empno from emp by empno group)

  • Remove af line: table

    Hi all

    I CHOSE to use Oracle 10 g with EJB.

    I have an af:table that fills with the rows returned from an EJB session bean method. In the last column, I have a command button 'delete line' with an action associated with it.
    As the name suggests, the action is to delete the row in the table and the underlying iterator.
    My action code is the following:


    int i is this. MyTableTable () .getRowIndex ();
    DCIteratorBinding iter is getBindings () .get ("myIterator) (DCIteratorBinding);.
    iter.setCurrentRowIndexInRange (i);
    pillPrescrIter.removeCurrentRow ();


    But the line is not deleted form the table.

    Any idea?

    Hello

    your code

    int i is this. MyTableTable () .getRowIndex ();
    DCIteratorBinding iter is getBindings () .get ("myIterator) (DCIteratorBinding);.
    iter.setCurrentRowIndexInRange (i);
    pillPrescrIter.removeCurrentRow ();

    But if the table is a simple select the model, the following code should do as well

    DCIteratorBinding iter is getBindings () .get ("myIterator) (DCIteratorBinding);.
    + iter.getCurrentRow () .remove ();

    The problem in your case is that this removes the line from the iterator, but not your business service. EJB exposes the explicit methods to remove an entity. A lime removeEmployees (employee) method young model EJB should be called.

    You can drag and drop the "removeEmployees" method and then as a button to your page. Rename the label of text for 'Remove' or 'delete '. In the open dialog box, point the argument of the method on the following PGE #{bindings.iteratorName.currentRow.dataProvider}. Next time you press the button, the line is removed from the iterator and business service

    Frank

  • How to remove a line empty in a table

    How to remove a line empty in a table?
    This is how to remove only a line including all columns as null values...
    Please help me

    Sounds strange, but you can use COALESCE to achieve this.

    ME_XE?create table all_nullz (col1 number, col2 number, col3 number);
    
    Table created.
    
    Elapsed: 00:00:00.20ME_XE?ME_XE?insert into all_nullz values (1,2,3);
    
    1 row created.
    
    Elapsed: 00:00:00.12ME_XE?insert into all_nullz values (null, null, null);
    
    1 row created.
    
    Elapsed: 00:00:00.06ME_XE?ME_XE?delete from all_nullz where coalesce(col1,col2,col3) is null;
    
    1 row deleted.
    
    Elapsed: 00:00:00.26ME_XE?
    
  • How to remove children lines with removal of multi line?

    Hello!

    I have a DSM process that removes the selected lines of the report, but it gives an error if the line have a child row in another table, so I have to go to this report and remove these first.

    Just add somewhere in the DSM process something then it removes children lines too, or I have to create new process for this?

    Hi EgaSega,

    DELETE will work if there is no foreign key constraints that refer to the line to remove.

    If you don't have foreign key constraints, you can change them to 'ON DELETE CASCADE '. This way, if you DELETE a row in a parent table, all child rows will be auotmatically DELETED, too.

    There are also "ON DELETE SET NULL', which allows you to DELETE the parent rows with children. When you DELETE a parent, child rows are not automatically DELETED, but the columns that pointed to the DELETED parent are automatically changed to null.

    Check out this old thread of discussion forum SQL and PL/SQL for more details:Delete record based on the ID of the main table

    Hope this helps you,

    Kind regards

    Jitendra

  • Remove all lines and insert them into Oracle can make performance worse?

    I m working in a project that I need to make a batch update regularly (every 4 months) of excel files. These files have doesn´t excellent key in their ranks.

    The development of a code that deletes all lines and inserts the entire base again is easier than one who checks in all the ranks of its primary key and if necessary update. (sometimes may be a key to 5 columns).

    My question is: if I delete all the rows in the tables of the insert it again, it will cause tablespace fragmentation and in a future loss of performance?

    Is there a way to avoid this?

    Thanks in advance

    Alexander

    This response helped me a lot.

    Thank you all

    Remove all lines and insert them into Oracle can make performance worse? -Stack overflow

  • How to remove a line in a PDF document?

    How to remove a line in a PDF so it's not an empty space left after that I have remove the text in the line I want to delete?

    Basically you don't have. PDF is not a file format of spreadsheet or word processing (see ISO 32000 for a description of this PDF "is").

    After enjoying a few eve readings long winter of the ISO standard, you will come to realize this PDF is no 'tables', the 'lines', the 'columns '...

    Content objects are "painted" on page PDF "canvas" - kinda sorta a paint-by-numbers thing.

    That said you can use content redaction Acrobat Pro for slick tool. Maybe not as elegant as you want, but if done correctly the content is gone (for sure, absolutely, forever).

    Be well...

  • remove header line records in the OPS

    Hi all

    I have a requirement as below:

    I have page master detail.

    I have two regions table advanced in my page.

    in the 1st picture I display data header and when I select a radio button for a line, the respective row data I'm filling in another region of the table below, my requirement is when I delete the header row in the 1st table area that the respective line lines should also remove in the 2nd table region.

    Could someone please help me on this

    Thnaks

    You must create the association for this entity. Visit this link:

    http://my.Opera.com/Isaias.Barroso/blog/Cascade-Delete-on-ADF

    Sushant-

  • How to remove data in three tables at once with the same key.

    I am new to Oracle ADF, I have a requirement like these, I have three tables such as employee salaries, teams of all these have a common EmpNo as common attribute, I have the search form these returns all employees related to this search query, when I click on the button Delete the particular employee data should delete all tables of the three based on the EmpNo.



    Any help is appreciated...

    (1) the easiest way is to mark the constraints of foreign key to WAGES employees and TEAMS of EMPLOYEES like ON DELETE CASCADE. The DB server then removes the necessary lines each time you remove a line from the employee.

    (2) another way is to implement a Before delete e-DB trigger on the EMPLOYEES table, where you can remove the related rows in other tables (have in mind that if you have foreign keys you can get an Exception Table mutation, so this approach is perhaps not very good).

    (3) an ADF is to implement a custom EntityImpl class for the Employee entity and substitute the remove() method where you can find the related entities of TeamMember and salary (via EntityAssoc accessors) and call remove() methods too.

    (4) another way of the ADF is to implement a custom EntityImpl class for the Employee entity and override the doDML() method where you can remove the lines needed in SALARIES and TEAMS through JDBC calls tables whenever a DELETE operation is performed on the Employee of the underlying entity.

    Dimitar

  • Remove empty lines Datamerge

    After the merger of a csv file that has empty fields for different data of the objects I have blank lines in my document merged - he leans on envelopes. So, here's what the data looks like when it is merged

    NAME

    < blank line - carriage return >

    Address

    City, State Zip

    Y at - it a command GREP that flipping through the pages of 2000 and will remove this empty cart/line back and pull up the rest of the text?

    I looked everywhere and have not yet find and commands GREP that will do it. I have a book on GREP this weekend.

    The remove blank lines option works (if they are really empty), and it's probably OK for this application. The problem is that it screw up paragraph styles, so it can be a disaster if you need to use styles for something like a Table of contents.

    There is a very long thread at http://forums.adobe.com/message/5866698#5866698 you might find interesting. During the discussion, Uwe Laubender worked on a script that removes the markers of merge field, and then blank lines and another for screwing the individual images in a single story, if you need to do.

Maybe you are looking for