How find out the duplicate value from each columns.

I have below four columns,
How can i find out the duplicate value from each columns.
with All_files as (
select '1000' as INVOICE,'2000' AS DELIVERYNOTE,'3000' CANDELINVOICE,'4000' CANDELIVERYNOTE from dual union all
select '5000','6000','7000','8000' from dual union all
select '9000','1000','1100','1200' from dual union all
select '1200','3400','6700','8790' from dual union all
select '1000','2000','3000','9000' from dual union all
select '1230','2340','3450','4560' from dual
SELECT * FROM All_files
Output should be as per below.
1000 2000 3000 4000
9000 1000 1100 1200
1200 3400 6700 8790
1000 2000 3000 9000
Required to check uniqueness in cross columns.
Thanks.

Try this (sorry about the formatting)...
WITH all_files AS (SELECT   '1000' AS INVOICE,
                            '2000' AS DELIVERYNOTE,
                            '3000' CANDELINVOICE,
                            '4000' CANDELIVERYNOTE
                     FROM   DUAL
                   UNION ALL
                   SELECT   '5000',
                            '6000',
                            '7000',
                            '8000'
                     FROM   DUAL
                   UNION ALL
                   SELECT   '9000',
                            '1000',
                            '1100',
                            '1200'
                     FROM   DUAL
                   UNION ALL
                   SELECT   '1200',
                            '3400',
                            '6700',
                            '8790'
                     FROM   DUAL
                   UNION ALL
                   SELECT   '1000',
                            '2000',
                            '3000',
                            '9000'
                     FROM   DUAL
                   UNION ALL
                   SELECT   '1230',
                            '2340',
                            '3450',
                            '4560'
                     FROM   DUAL),
    t_base
       AS (SELECT      invoice
                    || ','
                    || deliverynote
                    || ','
                    || candelinvoice
                    || ','
                    || candeliverynote
                       str
             FROM   all_files),
    t_str
       AS (SELECT   str || ',' AS str,
                    (LENGTH (str) - LENGTH (REPLACE (str, ','))) + 1
                       AS no_of_elements
             FROM   t_base),
    t_n_rows
       AS (    SELECT   LEVEL AS i
                 FROM   DUAL
           CONNECT BY   LEVEL <=
                           (    SELECT   SUM (no_of_elements) FROM t_str)),
    t_build AS (SELECT   t_str.str,
                         nt.i AS element_no,
                         INSTR (t_str.str,
                                DECODE (nt.i, 1, 0, 1),
                                DECODE (nt.i, 1, 1, nt.i - 1))
                         + 1
                            AS start_pos,
                         INSTR (t_str.str,
                                1,
                                DECODE (nt.i, 1, 1, nt.i))
                            AS next_pos
                  FROM      t_str
                         JOIN
                            t_n_rows nt
                         ON nt.i <= t_str.no_of_elements),
    t_build2
       AS (SELECT   RTRIM (str, ',') AS original_string,
                    SUBSTR (str, start_pos, (next_pos - start_pos))
                       AS single_element,
                    element_no
             FROM   t_build),
    t_build3
       AS (SELECT   single_element,
                    COUNT( * )
                       OVER (PARTITION BY single_element
                             ORDER BY single_element)
                       ele_count
             FROM   t_build2)
SELECT   DISTINCT INVOICE,
                  DELIVERYNOTE,
                  CANDELINVOICE,
                  CANDELIVERYNOTE
  FROM   all_files, t_build3
WHERE   ele_count > 1
         AND (   INVOICE = single_element
              OR DELIVERYNOTE = single_element
              OR CANDELINVOICE = single_element
              OR CANDELIVERYNOTE = single_element)I think this will be faster than the previous solution?
Cheers
Ben
Edited by: Munky on Feb 17, 2011 2:11 PM - "I think this will be faster than the previous solution?", nope - it's not :(

Similar Messages

  • Function module to find out the changed values from tables

    What is the standard function module to find out the changed values (the old & new values) from tables in SAP ?

    Hi Harish,
    Please elaborate your requirement...
    Please have a look on CDHDR AND CDPOS tables... it contains changed data... but all chages are not being tracked using it..
    Try Below FMs as well..
    For Header Level...
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
        EXPORTING
          date_of_change    = cdhdr-udate
          objectclass       = cdhdr-objectclas
          objectid          = cdhdr-objectid
          time_of_change    = cdhdr-utime
          username          = cdhdr-username
        TABLES
          i_cdhdr           = icdhdr
        EXCEPTIONS
          no_position_found = 1
          OTHERS            = 2.
    For Item Level
    CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
          EXPORTING
            changenumber      = icdhdr-changenr
          IMPORTING
            header            = cdhdr
          TABLES
            editpos           = icdshw
          EXCEPTIONS
            no_position_found = 1
            OTHERS            = 2.
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • How to restrict the duplicate values in lov column of VO based Adv Table

    Hi Gurus,
    I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
    If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
    After the duplicate values have been removed, then the user can save all the values in the table.
    My Adv Table is based on a VO.
    The link how to restrict the duplicate values at form level
    talks about Adv Table based on a EoVO, which doesnot work in my case.
    My Approach,
    I am iterating through RowSetIterator and committing through PROCEDURE.
    I am able to avoid duplicate entry through a function checkRespId. (given below)
    Below code is for iterating and committing.
    public void saveline(String reqid,String userid)
    System.out.println("RequestId/saveline"+reqid);
    System.out.println("UserId/saveline"+userid);
    OAViewObject vo = (OAViewObject)getRespLineVO1();
    RespLineVORowImpl row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    System.out.println("Inside the for LOOP");
    row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
    String respoidid = row.getAttribute("ResponsibilityId")+"";
    String respname = row.getAttribute("ResponsibilityName")+"";
    String stdate = row.getAttribute("StartDate")+"";
    String enddate = row.getAttribute("EndDate")+"";
    String linestatus ="A";
    if(userid!=null)
    if(!(respoidid.equals("null")) && respoidid!=null)
    String checkingrespid=null;
    checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
    System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
    if(checkingrespid.equals("No"))
         String message, result = null;
    Connection txn = getOADBTransaction().getJdbcConnection();
    try
    calling PROC ...
    catch(Exception e)
    message = "Error in Inserting into line" + e;
    throw new OAException(message, OAException.ERROR);
    else
    throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
    else
    System.out.println("respoidid is null");
    break;
    deleteIter.closeRowSetIterator();
    public String checkRespId(String userid,String respoidid)
    String createRow="No";
    OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
    if (vo != null)
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0, userid);
    vo.setWhereClauseParam(1, respoidid);
    vo.executeQuery();
    System.out.println("ROW COUNT IS "+vo.getRowCount());
    if(vo.getRowCount()>0)
    createRow="Yes";
    else
    createRow="No";
    return createRow;
    Problem:
    I remove the duplicate entries and click on save and get this error.
    Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
    \nAction: Cancel the transaction and re-query the record to get the new data.
    Thanks,
    Sombit

    Hi Anil,
    I am trying out your code but stuck in inserting the rows
    using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
    I am always getting the same exception i.e COde blast in when I run.
    My modified code is:
    String[] as = null;
    Number[] vNumber = null;
    Number[] vNumberrespid = null;
    Number reqidnumber = null;
    reqidnumber = new Number(Integer.parseInt(reqid));
    Connection txn = getOADBTransaction().getJdbcConnection();
    String mCreateSearchRequestStatement = null;
    OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
    int j = vo.getFetchedRowCount();
    try
    System.out.println("abouce try");
    vo.reset();
    if (vo.getFetchedRowCount() > 0)
    System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
    int i = 0;
    as = new String[j];
    vNumber = new Number[j];
    vNumberrespid = new Number[j];
    while (vo.hasNext())
    vo.next();
    System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
    vNumber[i] = (reqidnumber);
    vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
    as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
    System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
    System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
    System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
    i++;
    CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
    ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
    cs.setArray(1, array);
    cs.setArray(2, arraynew);
    cs.setArray(3, array1);
    cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
    cs.execute();
    ARRAY error = null;
    error = (ARRAY)cs.getArray(2);
    if ((error != null) && (error.length() > 0))
    System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
    String[] retError = new String[j];
    retError = (String[])error.getArray();
    System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
    cs.close();
    catch (Exception exception)
    throw new OAException("code blast", OAException.ERROR);
    Thanks,
    Sombit

  • How to remove all duplicate values from a column

    For some reason when a user is adding a record, it duplicates it three times. Why is that happening?
    Since there is many how can I remove any records that contains a duplicate in a specific column?

    Is this happening for all lists in site collection or this is the only one?
    Check on the list if there is any workflow attached. If yes then open the workflow in designer and check its logic it might be written to copy list items.
    Investigate if there is an event receiver deployed in your site where it creates duplicate entries. There has to be some custom code running which is causing this duplication otherwise out of the box behavior of lists is never like this.
    Please remember to click 'Mark as Answer'
    if the reply answers your query or 'Upvote' if it helps you.

  • How to find out the invoice value from a sales order

    Hi All,
    Please can any one hlpe to solve the beloq query.
    Is there any report in SAP , which give you the following.
    Sales order , Total cost incurred , Total revenue recoganised , Total Invoiced , Total collected .
    Thanks ,
    Rajesh

    Dear Waman,
    Thanks a lot for your replay ..
    But i don't have much knowldge about KE 30 report , is there any study meterial available online to configure this \ or study this report .

  • How can I find out the mail server from email address?

    Hi:
    How can I find out the mail server from email address?
    for example: If I know the email address is [email protected],
    how to find the pop3 and smtp mail server?
    THANK YOU

    You can't tell by the email address since you can pretty much put whatever you want in there (especially if the SMTP server is not filtering anything).
    The header may be able to tell you something. There is a Received header value which looks like it has the routing information although I am not sure if this is a complete trace or just the last hop the message took.
    Sean

  • How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi?

    How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi? There is probably a trivial, easy way to get this info, but I have not yet found it!  Thanks..

    Or if you want to grab all the paths programatically, try the attached VI.
    Open the top level that you want all the paths from and close all others, then open the
    attached and run it. It will return an array of all the VIs that the VI
    in question uses, including vi.lib VIs. You can filter these as well if
    you like.
    Ed
    Message Edited by Ed Dickens on 08-01-2005 07:01 PM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Get all paths.vi ‏29 KB

  • How we can find out the default value of the initialization parameters

    Hi All,
    How we can find out the default value of the initilization parameters from oracle database.
    Thanks
    Shiju

    Hi,
    you can find currently used parameter values v$parameter and v$parameter2.
    if default values is different real values then you can see alert.log.
    because in alert.log you will see non default values, rests is default.
    Edited by: admin on May 8, 2010 3:41 AM

  • How to find out the ASCII Values for Spanish character

    Hi,
    I had an requirement to store Spanish character and also need to fileter the records based on the Spanish character.
    Kindly guide me for below.
    To filter the Records which contains spanish characters?
    To get the ASCII Values for the particular column?
    E.g. we can find out the ASCII value of 'a' by using the syntax select ASCII('a') from dual.
    But I want to find the ASCII Values for the particular column value. Ie. name.
    E.g., Client name is "Suresh", I want to the ASCII Values for entire name of "Suresh".
    Kindly do the needful help / Guidance on this.
    Thanks,
    Orahar

    To expand on what I said in my first post, you want to do something along these lines:
    with t (thename) as
      select 'Suresh' from dual
    select thename
         , substr(TheName, level, 1)
         , ascii(substr(thename, level))
      from t
    connect by level <= length(thename);The output of the above query is:
    THENAM S ASCII(SUBSTR(THENAME,LEVEL))
    Suresh S                           83
    Suresh u                          117
    Suresh r                          114
    Suresh e                          101
    Suresh s                          115
    Suresh h                          104
    6 rows selected.Note that the WITH statement is only there to simulate a table for this example. With a table, all you do is get rid of the with and substitute the name "t" for the name of your table (also the name of the column to whatever name the column has in your table).
    Lastly, I suggest you post your question along with, an example table and the output you'd like to get in the PL/SQL forum. There are people there that will give you all kinds of great ways of solving that problem.
    HTH,
    John.

  • HOw to find out the RFC destination from BW system to ISU

    Hi,
    Currently my requirement is to call a function module which is written in ISU (remote enabled) from BW system.
    I am unable to find out the rfc destination from BW to ISU system.
    In CRM we have table like smofparsfa1. Is there any table in BW which can provide me the ISU destination?
    I need to compare the records stored in isu as well as in BW system.
    I need to call a function module which will provide me the data from isu.
    please help me in this regard.
    Krishna

    Hi,
    You can check it in SM59 if there are any RFC destinations for the above systems.
    Alternatively ,check the table RFCDEST if any entries are maintained
    Regards,
    Lakshman.

  • Find out the peak position from graph

    Hello All,,
    Actually i want to run this algorithm real time,, to find out the peak position from graph ,, i need to generate the position automatically,,, firstly i try to use image processing by  apply threshold followed by edge detection and the find out the center of each  detected part. the drawpack of this procedure is that the obtained images are different and that lead to different threshold values,, so how can i directly find the position from the graph,,, here i attach the image and the graph of the image,,
    thank you,,
    Attachments:
    11.png ‏15 KB
    13.PNG ‏85 KB

    Hello Klemen: 
    here i will explain in more details: the main objective of my work is to calculate velocity of small particle,, i perform my experiments by exposing the particle to 2 light pulses,, and i know the time between the two pulses,, so i need to know the distance to calculate the velocity,,, for that i apply correlation,,, the spot that appear in the correlation image is an indication of symmetry,,,so i should know the location of maximum intensity of each peak. The central peak (highest intensity) will be the reference (zero point) and the other peaks locations should be subtracted from the reference peak to determine the shift,,,
    Here is the sequence of the process:
    Acquiring raw image, correlation, position of central peak, shift calculation, velocity determination,,,,,
    applying image processing is good idea in case of post processing condition,,, but in my case i need it real time, that mean if i need to apply image processing for calculation, i have to find out a universal criteria for threshold value that can be applied for all raw images,, from my experiments i didn't find specific criteria & i have to manually change the threshold value,,
    If I choose the intensity (grey level) to be the criteria, then the small peaks (symmetry) will not take place,, because their intensity is very low compare to the central peak,,,
    So the most reliable procedure is to directly find out the position of the two small peaks beside the central peak and save this values into an array and use it for calculation,,, I hope I am clearly explain my problem..
    Thanks 
    Attachments:
    7-2.png ‏36 KB
    7-1.png ‏3 KB
    7-700.PNG ‏123 KB

  • Function Module to find out the release value in contract

    Dear All,
    I have to upload the contract with new accoutn assignment without changing the existing contract. For that i have to download all the existing contract data with value.
    In that case i have some issues regarding the value.
    For example : In the system old contract is created with value 1000 and the released value as 500.
    In that case i have to uload the new contract with all the details of existing contract with value of 500 (1000-500=500).
    How can i get the value (500) and from which table.Is there any functional module to find out the release value in contract.
    Thanks and regads,
    PM
    Edited by: PM on Jan 21, 2010 8:40 AM
    Edited by: PM on Jan 22, 2010 9:48 AM

    Hi
    You need to link the table VBFA and VBAK.
    For a contract you can check all the subsequent document (which you can filter whether you want to see Order / delivery / Billing) in VBFA and then from there pick the subsequent document no. and then from VBAK you can pick the Net value of these subsequent documents, and so you will have both the values (value of Contract and value in subsequent document) and you can determine the balance value.
    Regards
    Amitesh Anand

  • How to find out the length of a LONG column?

    How can I find out the length of a LONG column, I should write a stored procedure which will return me the length of a LONG column passed as an argument to it!
    any ideas or suggestions? please respond, i need this urgently, or you can mail me at [email protected]
    thanks,
    srini

    Actually a LONG variable in PL/SQL maxes out at 32K, so this would not be accruate. If you are running Oracle 8+, you could do a conversion to LOB which will give you an accurate length. Note, this example needs a table created to hold the converted lob value, you can't do it directly in pl/sql:
    create table lobhold
    (templob clob);
    declare
    mylength number;
    begin
    execute immediate 'insert into lobhold select to_lob(text) from equipment_notes where equipment_id=1448';
    select dbms_lob.getlength(templob) into mylength
    from templob;
    dbms_output.put_line(mylength);
    execute immediate 'truncate table lobhold';
    end;

  • How to avoid the duplicate values, I do not want the duplicate............

    i have one database table called "sms1" that table is updated every day or on daily basis it has the following fields in it:
    SQL> desc sms1;
    Name Null? Type
    MOBILE NUMBER
    RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)
    SNO NUMBER
    INDATE DATE
    From this table the is one column "RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)" . I am splitting it into different columns like :
    SQL> desc smssplit;
    Name Null? Type
    R VARCHAR2(2 CHAR)
    C VARCHAR2(2 CHAR)
    S VARCHAR2(1 CHAR)
    TC VARCHAR2(3 CHAR)
    NA VARCHAR2(3 CHAR)
    TC2 VARCHAR2(3 CHAR)
    NA2 VARCHAR2(3 CHAR)
    TC3 VARCHAR2(3 CHAR)
    NA3 VARCHAR2(3 CHAR)
    TC4 VARCHAR2(3 CHAR)
    NA4 VARCHAR2(3 CHAR)
    WTHER VARCHAR2(10 CHAR)
    SNO NUMBER
    INSERTDATA VARCHAR2(25 CHAR)
    Now I am written a procedure to insert the data from "Sms1" table to smssplit table...
    CREATE OR REPLACE PROCEDURE SPLITSMS
    AS
    BEGIN
    INSERT INTO scott.SMSSPLIT ( R,C,S,TC,NA,TC2,NA2,TC3,NA3,TC4,NA4,WTHER,SNO)
    SELECT SUBSTR(RCSTCNATCNATCNATCNAWTHER,1,2) R,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,3,2) C,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,5,1) S,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,6,3) TC,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,9,3) NA,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,12,3) TC2,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,15,3) NA2,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,18,3) TC3,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,21,3) NA3,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,24,3) TC4,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,27,3) NA4,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,30,10) WTHER, SNO
    FROM scott.SMS1 where SNO=(select MAX (sno) from SMS1);
    END;
    Now in order to update the second table with data from first table on regular basis I have written a job scheduler and I am using oracle 9.0. version...
    DECLARE
    X NUMBER;
    JobNumber NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    job => X
    ,what => 'scott.SPLITSMS;'
    ,next_date => SYSDATE+1/1440
    ,interval => 'SYSDATE+1/1440 '
    ,no_parse => FALSE
    :JobNumber := to_char(X);
    END;
    Now this job scheduler is working properly and updating the data for every one minute but it is taking or updating the duplicate values also ..like example:
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:49:16
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:49:16
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:50:17
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:50:17
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:51:19
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:51:19
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:52:20
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:52:20
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:53:22
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:53:22
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:54:45
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:54:45
    Now I do not want the duplicate values to be updated ...and want them to ignore them.....
    please I need a help on this query........How to avoid the duplicate values............

    Look at the posts closely:might not be needed if formatted ;)
    create or replace procedure splitsms as
    begin
      insert into scott.smssplit (r,c,s,tc,na,tc2,na2,tc3,na3,tc4,na4,wther,sno)
      select substr(rcstcnatcnatcnatcnawther,1,2) r,
             substr(rcstcnatcnatcnatcnawther,3,2) c,
             substr(rcstcnatcnatcnatcnawther,5,1) s,
             substr(rcstcnatcnatcnatcnawther,6,3) tc,
             substr(rcstcnatcnatcnatcnawther,9,3) na,
             substr(rcstcnatcnatcnatcnawther,12,3) tc2,
             substr(rcstcnatcnatcnatcnawther,15,3) na2,
             substr(rcstcnatcnatcnatcnawther,18,3) tc3,
             substr(rcstcnatcnatcnatcnawther,21,3) na3,
             substr(rcstcnatcnatcnatcnawther,24,3) tc4,
             substr(rcstcnatcnatcnatcnawther,27,3) na4,
             substr(rcstcnatcnatcnatcnawther,30,10) wther,
             sno
        from scott.sms1 a
       where sno = (select max(sno)
                      from sms1
                     where sno != a.sno
                   ); ---------------> added where clause with table alias.
    end;Regards
    Etbin

  • How to delete the duplicate data  from PSA Table

    Dear All,
    How to delete the duplicate data  from PSA Table, I have the purchase cube and I am getting the data from Item data source.
    In PSA table, I found the some cancellation records for that particular records quantity  would be negative for the same record value would be positive.
    Due to this reason the quantity is updated to target but the values would summarized and got  the summarized value  of all normal and cancellation .
    Please let me know the solution how to delete the data while updating to the target.
    Thanks
    Regards,
    Sai

    Hi,
    in deleting the records in PSA table difficult and how many you will the delete.
    you can achieve the different ways.
    1. creating the DSO maintain the some key fields it will overwrite the based on key fields.
    2. you can write the ABAP logic deleting the duplicate records at info package level check with the your ABAPer.
    3.you can restrict the cancellation records at query level.
    Thanks,
    Phani.

Maybe you are looking for

  • Express document "Update was terminated" received from author in MM01

    Hi gurus, When we are trying to create the MM by using the t-code MM01 we are getting the error message as Express document "Update was terminated" received from author "XXXX". Based on this error we have verified the t-code SM13 and received the bel

  • Hi all of a sudden all my bookmarks have "F" and if I click on one it goes to facebook!!!

    Hi all of a sudden all my bookmarks have "F" and if I click on one it goes to facebook!!! And I cannot add more bookmarks. How can this be fixed??? Please help. I mean, I mean what the F :-) Alices restaurant. I do not know how the F got in front of

  • Generate stem list

    Hi, How to generate a list of the available stems in a field or a parial list (for example the stems in a field which begin with "a" or "te") ? Zsolt

  • Missing part of my page on a particular web site

    I recently installed Adblock Plus because I had 2 web sites that were placing ads (World of Watchs and Ebags) at the bottome of my Cityville web page. After installing Adblock, the ads are gone but the portion of the page where they were was not recl

  • Premiere 7 crashes while burning disk

    Help! I am having problems with Premiere 7 crashing as various points while I am using the program. It seems to crash most often when I am trying to burn a disk. How can I fix this problem? Thank you!!