How to Select the duplicate records in the table

Hi
SELECT * FROM gin A WHERE A.sale_order_id IN (
SELECT sale_order_id FROM gin GROUP BY sale_order_id
HAVING COUNT(sale_order_id)>1)
AND A.ROWID!=MIN (ROWID))
ERROR at line 4:
ORA-00934: group function is not allowed here
Thanks
Vikas Singhal

Try this out
select *
from gin a
where a.rowid > any (select b.rowid
from gin b
where a.col1 = b.col1
and a.col2 = b.col2);
Regards
Ozy
[www.oraclevillage.com]
Edited by: Ozy on Feb 4, 2009 4:12 AM

Similar Messages

  • How to delete the duplicate records in a table without promary key

    I have a table that contains around 1 million records and there is no promary key or auto number coulums. I need to delete the duplicate records from this table. what is the simple effective way to do this.

    Please see this link:
    Remove duplicate records ...
    sqldevelop.wordpress.com

  • To find the duplicate record in internal table

    Hi,
    i have a requirement to fine the duplicate record with 3 fields.
    i am getting a flat file with 15 fields  .
    i need to check the duplaicate records of  3 fields . if i get any 2nd same record of 3 fields , the records will go to other internal table.
    for ex :
    1. aaa  bbb ccc ddd  eee  fff  ggg   hhh
    2. aaa  bbb ccf  dde edd  ffg ggh   hhj
    3. aaa  bbb cce ddd  ees ffh  ggu  hhk
    in that 1st record and 3rd record are same (aaa bbb ddd)
    i need to find 3rd record
    please help me
    regrards
    srinivasu

    hi,
    itab2[] = itab1[].
    sort itab1 by f1 f2 f3.
    sort itab2 by f1 f2 f3.
    delete itab2 index 1.   "to delete the first record in itab2.
    loop at itab1 into ws_itab1.
      loop at itab2 into ws_itab2.
       if ws_itab1-f1 = ws_itab2-f1 and
         ws_itab1-f2 = ws_itab2-f2 and
        ws_itab1-f3 = ws_itab2-f3.
         ws_itab3 = ws_itab2.
         append ws_itab3 into itab3.   "Third internal table.
       endif.
    endloop.
    delete itab2 index 1.   
    endloop.
    ITAB3 will have all the duplicate records.
    Regards,
    Subramanian

  • How can I view duplicate records in a table?

    Hello everyone,
    My question is very straight forward. How can I view all duplicate records?
    Thanks in advance,
    Sonya

    Easy enough,
    select t1.n1,t1.c1,count(*) as "TOTAL_DUPS" from tableA t1 having count(*) > 1 group by t1.n1,t1.c1 order by count(*) desc
    Tyler

  • 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.

  • Deleting the duplicate records

    Hi all,
    I have some duplicate records in the PSA . and i want to delete the duplicate records before the data is entered into the data target. Can anybody tell me how to achieve this.
    Actually i need to achieve this  by using the ABAP code.
    Thanx & Regards,
    RaviChandra
    Edited by: Ravichandra.bi on Mar 5, 2012 3:37 PM

    Hi Ravi,
    If its a full load to the PSA and because of it you are getting duplicate records and you want to eliminate them,
    you can do what  Anshul and Durgesh suggested.
    Write the code in the start routine of the transformation to your target
    SORT SOURCE_PACKAGE BY KEY1 KEY2 KEY3. "(The key will be the key of your target)
    DELETE ADJACENT DUPLICATES FROM SOURCE_PACKAGE
          COMPARING KEY1 KEY2 KEY3.
    Hope this helps
    Regards,
    Joe

  • Duplicate Records in the InfoCube how should i do to fix it?

    Hi All,
    we have different values between R/3 and BW, in the first control i find that in the cube i have duplicate records, how should i do to control and fix step by step this problem.
    the Infocube receive data from 7 ODS.
    let me know if you need further detail about our data model or load
    thanks a lot for your help
    Bilal

    Hello All,
    please i need further detail to don't make critical errors in the cube.
    when i control data in my infocube right click ==> view data with this selection
    0GL_ACCOUNT= R060501950
    0PSTNG_DATE= from 01.01.2009 to 31.03.2009
    i find duplicate records for all this info:
    0GL_ACCOUNT, 0CO_DOC_NO, 0DOC_DATE, 0PSTNG_DATE, 0COORDER, 0FISCPER... and all the key figures.
    to delete this duplicate records i have to make selections going: Manage ==> Contents tab ==> selective deletion (in the right corner beside) ... at this step what should i do?
    i have start in background or i can select "Selective Deletion"
    for this selective deletion which kind of info i have to put in reletion with my problem explained before
    0GL_ACCOUNT= R060501950
    0PSTNG_DATE= from 01.01.2009 to 31.03.2009
    IF I PUT THIS INFO AND EXECUTE wich records the system will delete? all the records with this selections or only the DUPLICATE RECORDS?
    Thanks a lot for your help
    Bilal

  • How to delete the duplicate rows present in the parent table & insert the latest duplicate record into the parent table linked with the child table.

    I have a master table and i need to import the rows into the parent and child table.
    Master table name is Flatfile_Inventory
    Parent Table name is INVENTORY
    Child Tables name are INVENTORY_AMOUNT,INVENTORY_DETAILS,INVENTORY_VEHICLE,
    Error details will be goes to LOG_INVENTORY_ERROR
    I have 4 duplicate rows in the Flatfile_Inventory which i have already inserted in the Parent and child table.
    Again when i run the query using stored procedure,
    its tells that all the 4 rows are duplicate and will move to the Log_Inventory_Error.
    I need is if i have the duplicate rows in the flatfile_Inventory when i start inserting into the parent and child table the already inserted row have the unique ID i
    must identify it and delete that row in the both parent and chlid table.And latest row must get inserted into the Parent and child table from Flatfile_Inventory.
    Please help me to write the query i have attached the Full stored procedure Script..
    Arunraj Kumar

    Hi Santhosh,
    This is my Script.
    -- =============================================
    -- Stored Procedure for FLATFILE_INVENTORY
    -- =============================================
    -- Drop stored procedure if it already exists
       DROP PROCEDURE SP_Flatfile_Inventory
    GO
    CREATE PROCEDURE SP_Flatfile_Inventory
    AS
    --USE IconicMarketing
    GO
    DECLARE
    @FileType  varchar(50)  ,
    @ACDealerID  varchar(50)  ,
    @ClientDealerID  varchar(50)  ,
    @DMSType  varchar(50)  ,
    @StockNumber  varchar(50)  ,
    @InventoryDate  datetime  ,
    @StockType  varchar(100)  ,
    @DMSStatus  varchar(50)  ,
    @InvoicePrice  numeric(18, 2)  ,
    @CostPack  varchar(50)  ,
    @SalesCost  numeric(18, 2)  ,
    @HoldbackAmount  numeric(18, 2)  ,
    @ListPrice  numeric(18, 2)  ,
    @MSRP  varchar(max)  ,
    @LotLocation  varchar(50)  ,
    @TagLine  varchar(max)  ,
    @Certification  varchar(max)  ,
    @CertificationNumber  varchar(max)  ,
    @VehicleVIN  varchar(50)  ,
    @VehicleYear  bigint  ,
    @VehicleMake  varchar(50)  ,
    @VehicleModel  varchar(50)  ,
    @VehicleModelCode  varchar(50)  ,
    @VehicleTrim  varchar(50)  ,
    @VehicleSubTrimLevel  varchar(max)  ,
    @Classification  varchar(max)  ,
    @TypeCode  varchar(100)  ,
    @VehicleMileage  bigint  ,
    @EngineCylinderCount  bigint  ,
    @TransmissionType  varchar(50)  ,
    @VehicleExteriorColor  varchar(50)  ,
    @VehicleInteriorColor  varchar(50)  ,
    @CreatedDate  datetime  ,
    @LastModifiedDate  datetime  ,
    @ModifiedFlag  varchar(max)  ,
    @InteriorColorCode  varchar(50)  ,
    @ExteriorColorCode  varchar(50)  ,
    @PackageCode  varchar(50)  ,
    @CodedCost  varchar(50)  ,
    @Air  varchar(100)  ,
    @OrderType  varchar(max)  ,
    @AgeDays  bigint  ,
    @OutstandingRO  varchar(50)  ,
    @DlrAccessoryRetail  varchar(50)  ,
    @DlrAccessoryCost  varchar(max)  ,
    @DlrAccessoryDesc  varchar(max)  ,
    @ModelDesc  varchar(50)  ,
    @Memo1  varchar(1000)  ,
    @Memo2  varchar(max)  ,
    @Weight  varchar(max)  ,
    @FloorPlan  numeric(18, 2)  ,
    @Purchaser  varchar(max)  ,
    @PurchasedFrom  varchar(max)  ,
    @InternetPrice  varchar(50)  ,
    @InventoryAcctDollar  numeric(18, 2)  ,
    @VehicleType  varchar(50)  ,
    @DealerAccessoryCode  varchar(50)  ,
    @AllInventoryAcctDollar  numeric(18, 2)  ,
    @BestPrice  varchar(50)  ,
    @InStock  bigint  ,
    @AccountingMake  varchar(50)  ,
    @GasDiesel  varchar(max)  ,
    @BookValue  varchar(10)  ,
    @FactoryAccessoryDescription  varchar(max)  ,
    @TotalReturn  varchar(10)  ,
    @TotalCost  varchar(10)  ,
    @SS  varchar(max)  ,
    @VehicleBody  varchar(max)  ,
    @StandardEquipment  varchar(max)  ,
    @Account  varchar(max)  ,
    @CalculatedPrice  varchar(10)  ,
    @OriginalCost  varchar(10)  ,
    @AccessoryCore  varchar(10)  ,
    @OtherDollar  varchar(10)  ,
    @PrimaryBookValue  varchar(10)  ,
    @AmountDue  varchar(10)  ,
    @LicenseFee  varchar(10)  ,
    @ICompany  varchar(max)  ,
    @InvenAcct  varchar(max)  ,
    @Field23  varchar(max)  ,
    @Field24  varchar(max)  ,
    @SalesCode  varchar(max)  ,
    @BaseRetail  varchar(10)  ,
    @BaseInvAmt  varchar(10)  ,
    @CommPrice  varchar(10)  ,
    @Price1  varchar(10)  ,
    @Price2  varchar(10)  ,
    @StickerPrice  varchar(10)  ,
    @TotInvAmt  varchar(10)  ,
    @OptRetail  varchar(max)  ,
    @OptInvAmt  varchar(10)  ,
    @OptCost  varchar(10)  ,
    @Options  varchar(max)  ,
    @Category  varchar(max)  ,
    @Description  varchar(max)  ,
    @Engine  varchar(max)  ,
    @ModelType  varchar(max)  ,
    @FTCode  varchar(max)  ,
    @Wholesale  varchar(max)  ,
    @Retail  varchar(max)  ,
    @Draft  varchar(max)  ,
    @Inventoryid int;
    DECLARE Inventory_Cursor CURSOR FOR 
    SELECT * from [dbo].[FLATFILE_INVENTORY];
    OPEN Inventory_Cursor
    FETCH NEXT FROM Inventory_Cursor 
    INTO @FileType   ,
    @ACDealerID     ,
    @ClientDealerID     ,
    @DMSType     ,
    @StockNumber     ,
    @InventoryDate    ,
    @StockType    ,
    @DMSStatus     ,
    @InvoicePrice     ,
    @CostPack     ,
    @SalesCost     ,
    @HoldbackAmount     ,
    @ListPrice     ,
    @MSRP     ,
    @LotLocation     ,
    @TagLine     ,
    @Certification     ,
    @CertificationNumber     ,
    @VehicleVIN     ,
    @VehicleYear     ,
    @VehicleMake     ,
    @VehicleModel     ,
    @VehicleModelCode     ,
    @VehicleTrim     ,
    @VehicleSubTrimLevel     ,
    @Classification     ,
    @TypeCode    ,
    @VehicleMileage     ,
    @EngineCylinderCount     ,
    @TransmissionType     ,
    @VehicleExteriorColor     ,
    @VehicleInteriorColor     ,
    @CreatedDate    ,
    @LastModifiedDate    ,
    @ModifiedFlag     ,
    @InteriorColorCode     ,
    @ExteriorColorCode     ,
    @PackageCode     ,
    @CodedCost     ,
    @Air    ,
    @OrderType     ,
    @AgeDays     ,
    @OutstandingRO     ,
    @DlrAccessoryRetail     ,
    @DlrAccessoryCost     ,
    @DlrAccessoryDesc     ,
    @ModelDesc     ,
    @Memo1 ,
    @Memo2     ,
    @Weight     ,
    @FloorPlan     ,
    @Purchaser     ,
    @PurchasedFrom     ,
    @InternetPrice     ,
    @InventoryAcctDollar     ,
    @VehicleType     ,
    @DealerAccessoryCode     ,
    @AllInventoryAcctDollar     ,
    @BestPrice     ,
    @InStock     ,
    @AccountingMake     ,
    @GasDiesel     ,
    @BookValue     ,
    @FactoryAccessoryDescription     ,
    @TotalReturn     ,
    @TotalCost     ,
    @SS     ,
    @VehicleBody     ,
    @StandardEquipment     ,
    @Account     ,
    @CalculatedPrice     ,
    @OriginalCost     ,
    @AccessoryCore     ,
    @OtherDollar     ,
    @PrimaryBookValue     ,
    @AmountDue     ,
    @LicenseFee     ,
    @ICompany     ,
    @InvenAcct     ,
    @Field23     ,
    @Field24     ,
    @SalesCode     ,
    @BaseRetail     ,
    @BaseInvAmt     ,
    @CommPrice     ,
    @Price1     ,
    @Price2     ,
    @StickerPrice     ,
    @TotInvAmt     ,
    @OptRetail     ,
    @OptInvAmt     ,
    @OptCost     ,
    @Options     ,
    @Category     ,
    @Description     ,
    @Engine     ,
    @ModelType     ,
    @FTCode     ,
    @Wholesale     ,
    @Retail     ,
    @Draft     ;
    WHILE @@FETCH_STATUS = 0
    BEGIN
        PRINT @VehicleVIN    ;
    -- ****************** insert into Inventory Table ***********
    INSERT INTO INVENTORY 
    IconicDealerID,
    StockNumber,
    DMSType,
    InventoryDate
    VALUES (@ClientDealerID,@StockNumber,@DMSType,@InventoryDate);
    set @Inventoryid = scope_identity();
    PRINT @Inventoryid;
    --Insert into Inventory_Details Table
    INSERT INTO [INVENTORY_DETAILS]
    InventoryID,
    StockType,
    DMSStatus,
    LotLocation,
    TagLine,
    Certification,
    CertificationNumber,
    CreatedDate,
    LastModifiedDate,
    ModifiedFlag,
    PackageCode,
    OrderType,
    AgeDays,
    OutstandingRO,
    Memo1,
    Memo2,
    Purchaser,
    PurchasedFrom,
    DealerAccessoryCode,
    InStock,
    AccountingMake,
    SS,
    Account,
    AccessoryCore,
    ICompany,
    InvenAcct,
    Field23,
    Field24,
    SalesCode,
    Draft,
    FTCode
    VALUES (
    @InventoryID,
    @StockType,
    @DMSStatus,
    @LotLocation,
    @TagLine,
    @Certification,
    @CertificationNumber,
    @CreatedDate,
    @LastModifiedDate,
    @ModifiedFlag,
    @PackageCode,
    @OrderType,
    @AgeDays,
    @OutstandingRO,
    @Memo1,
    @Memo2,
    @Purchaser,
    @PurchasedFrom,
    @DealerAccessoryCode,
    @InStock,
    @AccountingMake,
    @SS,
    @Account,
    @AccessoryCore,
    @ICompany,
    @InvenAcct,
    @Field23,
    @Field24,
    @SalesCode,
    @Draft,
    @FTCode
    --Insert into Inventory_Amount Table
    INSERT INTO [dbo].[INVENTORY_AMOUNT]
    InventoryID,
    AllInventoryAcctDollar,
    OtherDollar,
    PrimaryBookValue,
    AmountDue,
    LicenseFee,
    CalculatedPrice,
    OriginalCost,
    BookValue,
    TotalReturn,
    TotalCost,
    DlrAccessoryRetail,
    DlrAccessoryCost,
    DlrAccessoryDesc,
    InternetPrice,
    InventoryAcctDollar,
    BestPrice,
    Weight,
    FloorPlan,
    CodedCost,
    InvoicePrice,
    CostPack,
    SalesCost,
    HoldbackAmount,
    ListPrice,
    MSRP,
    BaseRetail,
    BaseInvAmt,
    CommPrice,
    Price1,
    Price2,
    StickerPrice,
    TotInvAmt,
    OptRetail,
    OptInvAmt,
    OptCost,
    Wholesale,
    Retail
    VALUES (
    @InventoryID,
    @AllInventoryAcctDollar,
    @OtherDollar,
    @PrimaryBookValue,
    @AmountDue,
    @LicenseFee,
    @CalculatedPrice,
    @OriginalCost,
    @BookValue,
    @TotalReturn,
    @TotalCost,
    @DlrAccessoryRetail,
    @DlrAccessoryCost,
    @DlrAccessoryDesc,
    @InternetPrice,
    @InventoryAcctDollar,
    @BestPrice,
    @Weight,
    @FloorPlan,
    @CodedCost,
    @InvoicePrice,
    @CostPack,
    @SalesCost,
    @HoldbackAmount,
    @ListPrice,
    @MSRP,
    @BaseRetail,
    @BaseInvAmt,
    @CommPrice,
    @Price1,
    @Price2,
    @StickerPrice,
    @TotInvAmt,
    @OptRetail,
    @OptInvAmt,
    @OptCost,
    @Wholesale,
    @Retail
    --Insert into Inventory_Vehicle Table
    INSERT INTO [dbo].[INVENTORY_VEHICLE]
    InventoryID,
    InteriorColorCode,
    ExteriorColorCode,
    Air,
    ModelDesc,
    VehicleType,
    VehicleVIN,
    VehicleYear,
    VehicleMake,
    VehicleModel,
    VehicleModelCode,
    VehicleTrim,
    VehicleSubTrimLevel,
    Classification,
    TypeCode,
    VehicleMileage
    VALUES (
    @InventoryID,
    @InteriorColorCode,
    @ExteriorColorCode,
    @Air,
    @ModelDesc,
    @VehicleType,
    @VehicleVIN,
    @VehicleYear,
    @VehicleMake,
    @VehicleModel,
    @VehicleModelCode,
    @VehicleTrim,
    @VehicleSubTrimLevel,
    @Classification,
    @TypeCode,
    @VehicleMileage
    -- Move cursor to Next record 
        FETCH NEXT FROM Inventory_Cursor 
    INTO @FileType   ,
    @ACDealerID     ,
    @ClientDealerID     ,
    @DMSType     ,
    @StockNumber     ,
    @InventoryDate    ,
    @StockType    ,
    @DMSStatus     ,
    @InvoicePrice     ,
    @CostPack     ,
    @SalesCost     ,
    @HoldbackAmount     ,
    @ListPrice     ,
    @MSRP     ,
    @LotLocation     ,
    @TagLine     ,
    @Certification     ,
    @CertificationNumber     ,
    @VehicleVIN     ,
    @VehicleYear     ,
    @VehicleMake     ,
    @VehicleModel     ,
    @VehicleModelCode     ,
    @VehicleTrim     ,
    @VehicleSubTrimLevel     ,
    @Classification     ,
    @TypeCode    ,
    @VehicleMileage     ,
    @EngineCylinderCount     ,
    @TransmissionType     ,
    @VehicleExteriorColor     ,
    @VehicleInteriorColor     ,
    @CreatedDate    ,
    @LastModifiedDate    ,
    @ModifiedFlag     ,
    @InteriorColorCode     ,
    @ExteriorColorCode     ,
    @PackageCode     ,
    @CodedCost     ,
    @Air    ,
    @OrderType     ,
    @AgeDays     ,
    @OutstandingRO     ,
    @DlrAccessoryRetail     ,
    @DlrAccessoryCost     ,
    @DlrAccessoryDesc     ,
    @ModelDesc     ,
    @Memo1 ,
    @Memo2     ,
    @Weight     ,
    @FloorPlan     ,
    @Purchaser     ,
    @PurchasedFrom     ,
    @InternetPrice     ,
    @InventoryAcctDollar     ,
    @VehicleType     ,
    @DealerAccessoryCode     ,
    @AllInventoryAcctDollar     ,
    @BestPrice     ,
    @InStock     ,
    @AccountingMake     ,
    @GasDiesel     ,
    @BookValue     ,
    @FactoryAccessoryDescription     ,
    @TotalReturn     ,
    @TotalCost     ,
    @SS     ,
    @VehicleBody     ,
    @StandardEquipment     ,
    @Account     ,
    @CalculatedPrice     ,
    @OriginalCost     ,
    @AccessoryCore     ,
    @OtherDollar     ,
    @PrimaryBookValue     ,
    @AmountDue     ,
    @LicenseFee     ,
    @ICompany     ,
    @InvenAcct     ,
    @Field23     ,
    @Field24     ,
    @SalesCode     ,
    @BaseRetail     ,
    @BaseInvAmt     ,
    @CommPrice     ,
    @Price1     ,
    @Price2     ,
    @StickerPrice     ,
    @TotInvAmt     ,
    @OptRetail     ,
    @OptInvAmt     ,
    @OptCost     ,
    @Options     ,
    @Category     ,
    @Description     ,
    @Engine     ,
    @ModelType     ,
    @FTCode     ,
    @Wholesale     ,
    @Retail     ,
    @Draft     ;
    END 
    CLOSE Inventory_Cursor;
    DEALLOCATE Inventory_Cursor;
    GO
    SET ANSI_PADDING OFF
    GO
    Arunraj Kumar

  • How to retrieve the duplicates records.

    Hi friends,
         My next issue, how to retrieve the duplicate records in web intelligence.I checked the option Retrieve duplicate records in web intelligence as well.But it is not helping me.
    Hope you guys are help to solve this issue.
    Thanks lot,
    Regards,
    -B-

    hi Blaji,,
    ive tried this here and it worked perfectly with me
    even so, you dont need to make the QTY as a dimension, you can leave it as a measure also, and it will work good with you.
    click the block on the WebI, the Block itself.
    and find its properties, under "Display", you will find
    "Avoid Duplicate row Aggregations"
    in the query it self you should flag "Retrieve Duplicated Rows"
    i think this will work fine with you
    good luck
    Amr

  • How to remove the duplicate record in DART Extract

    Hi Guys,
    We are getting duplicate record when we do validate the DART extract file through DATA VIEWS for FI General Ledger Account Balances. If any one have experance on this, pls help us.
    Following are the steps we done to Validate the DART EXTRACT File for FI General Ledger Account Balances.
    1. We have run the DART extract program to extract the data from table to directory file by period vice in T.code FTW1A.
    2. When we do validate the data from DART extract file through DATA VIWE for FI General Ledger Account Balances in T.code FTWH, getting duplicate record.
    We unable to find out from where the duplicate records are coming out. will be great if any one can help us immediately.
    Thanks & Records,
    Boobalan,v

    If the dup records are actually in the DART View versus the DART Extract, you could try OSS Note 1139619 DART: Eliminate duplicate records from DART view.
    Additional Note - 1332571 FTWH/FTWY - Performance for "Eliminate duplicate records
    Colleen
    Edited by: Colleen Geraghty on May 28, 2009 6:07 PM

  • Duplicate records in the same table

    Hello.
    I want to duplicate records in the same table, changing just two date fields and id. Id is changed with sequence.
    Example:
    id name start_date end_date
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    I want to duplicate record with the start_date year 04 and the duplicated record would change that start_date into year 05.
    After duplicate it should look like:
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    3 record_1 01.01.05 31.12.05
    How should my insert look like?
    Thanks

    create sequence A_SEQ
       start with 3
       nocache
    insert into tableA
            (ID, name, start_date end_date)
       select
               A_SEQ.nextval   
              ,NAME
              ,start_date + add_months (12)
              ,end_date   + add_months (12)
         from
               tableA
        where
               start_date >= to_date('01.01.2004','dd.mm.yyyy')
          and  start_date <= to_date('01.01.2004','dd.mm.yyyy')

  • 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.

  • Remove duplicate records in the Footer

    Hello all:
    I only want to print the final result(distinct records) in the footer section, therefore, the header and details sections are suppressed. However, I'm showing duplicate records in the footer section. How do I suppress the duplicate records?
    Please help.....Thank you so much in advance
    Here are my formulas : 
    Header
    WhilePrintingRecords;
    StringVar ConCat:=""
    Details
    WhilePrintingRecords;
    StringVar Concat;
    ConCat := Concat + Trim(ToText({MEDICATE.STARTDATE},"MM/dd/yyyy") + chr(7) + {MEDICATE.DESCRIPTION}) + chr(13)
    Footer
    WhilePrintingRecords;
    StringVar ConCat;
    Here's my desired output:
    HUMALOG PEN 100 UNIT/ML SOLN
    LANTUS 100 U/ML SOLN
    METFORMIN HCL 1000 MG TABS
    Below is an example my current output:
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-HUMALOG PEN 100 UNIT/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    11/24/2009-LANTUS 100 U/ML SOLN
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS
    01/24/2007-METFORMIN HCL 1000 MG TABS

    Sorry, I forgot to mention I'm already grouping by Patient Name, and that's where I have created a formula called:
    MEDSHEAD - which I've modified and added the concat line.
    WhilePrintingRecords;
    //StringVar ConCat:="";
    StringVar ConCat;
    ConCat := Concat + Trim(ToText({MEDICATE.STARTDATE},"MM/dd/yyyy") + chr(7) + {MEDICATE.DESCRIPTION}) + chr(13);
    In the detail section : I'm displaying the the patient's name, DOB and Gender and the hemoglabin lab result and date of the lab result.
    In the patient's footer section is where I have the formula called: medsfooter (WhilePrintingRecords; StringVar Concat; Concat;)
    The changes that I made, eliminate some of the duplicate records, however, it's no longer initializing the values - what I meant is I am getting the previous patient's medication information:
    See output below:
    Patient One              4/25/1958     F
    6/26/09 12.2
    9/2/2008-Glipizide XL 5 MG TB24
    4/2/2009-Novolog 100 unit/ml soln
    Patient Two          12/11/45       F
    9/2/2008-Glipizide XL 5 MG TB24
    4/2/2009-Novolog 100 unit/ml soln
    11/24/2009-Humalog Pen 100 Unit/ML soln

  • Why do we have a duplicate record in the .wsr file of the mail.dat?

    Any idea how we could have created a duplicate record in the .wsr (walk Sequence file)?   We have a post presort software that errors out because of the dupe.   The Mail.dat specification indicates that there are five 'key' fields (their combination must be unique) for the Walk Sequence file:

    Hi Michael
    Can you please tell me which field is being duplicated and can you please try to run the job again and wait for a couple of seconds before importing it to your post presort software.
    Thanks
    Anita.

  • Start routine to filter the duplicate records

    Dear Experts
    I have two questions regarding the start routine.
    1) I have a characteristic InfoObject with transactional InfoSource. Often the 'duplicate records' error happens during the data loading. I'm trying to put a start routine in the update rule to filter out the duplicate records. 
    After searching the SDN forum and SAPHelp, I use the code as:
    DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING KEY1 KEY2 KEY3.
    In my case, the InfoObject has 3 keys: SOURSYSTEM, /BIC/InfoObjectname, OBJVERS. My code is:
    DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING SOURSYSTEM /BIC/InfoObjectname OBJVERS.
    When checking the code I got message: 'E:No component exists with the name "OBJVERS".' So I only included the first 2 keys. But the routine does not work. The duplicate error is still happening. What is missing in this start routine?
    2) Generally, for a start routine, do I really need to include the data declaration, ITAB or WA, SELECT statement etc.?
    Do I have to use the statement below or just simply one line?
    LOOP AT DATA_PACKAGE.
    IF DATA_PACKAGE.....
    ENDIF.
    ENDLOOP.
    Thanks for your help in advance, Jessica

    Hello Jessica,
    if it won't be possible for you to get unique data from the very beginning, there is still another way to manage this problem in a start routine.
    Sort ... and delete adjacent ... must remain. Further on build up an internal table of type data_package, but defined with STATICS instead of DATA. This i-tab stays alive for all data-packages of one load. Fill it with the data of the transferred data-packages, and delete from every new data-package all records which already are in the statics i-tab. Alternatively you could do the same with a Z-(or Y-)database-table instead of the statics i-tab.
    It will probably cost some performance, but better slow than wrong data.
    Regards,
    Ernst

Maybe you are looking for

  • I can no longer record video on  my iPad since the upgrade!

    I went to record something on video this morning, and tapped "video" on my screen, and it did nothing.  Can't seem to activate the record video button since the last upgrade of 07!

  • Regarding  File name schema in  Receiver  com. Channel

    Hello, I have gone thru  the blog The specified item was not found. "The same filename from a sender to a receiver file adapter - SP14 for Dynamic configuration"  by Michal Krawczyk....And here in this Scenario in ID (in Reeiver communiation channel)

  • Files will not open in photoshop

    Photshop Elements 8 ... opens fine... but when i go to open a file in it will go to the photoshop screen but file will not come up ... no errors etc it just wont open .. Help please

  • VL10B Error message M7041

    Hello all! I have a problem with transaction VL10B, when create Deliveries with reference STO. Since 4 months ago the process run correctly. In ME21N transaction create the STO. After create delivery at transaction VL04 and VL10B. Up to here all perf

  • Execute immediate with a string longer than 32767

    hello, is there a possibility to make an execute immediate with a statement, that is longer than the 32767 max. bytes for varchar`s? We get in a CLOB SQL-Statements with data that are longer than 32767. It would be easy if it were possible to make an