How to display only the duplicate records

Hi friends,
I have a query that provides me with a set of data,which has some duplicate rows. I require to display only the duplicates.
This is the result I have:
card_no cust_no address paymnt_mode
1234 A123 XYZ CQ
1234 A234 nmb CC
9876 B123 mnnjn cc
5678 A123 XYZ CQ
5678 A123 XYZ CQ
7876 Mk89 mku CC
From the above ,
I require to display something like this:(Duplicates based on card number alone)
card_no cust_no address paymnt_mode
1234 A123 XYZ CQ
1234 A234 nmb CC
5678 A123 XYZ CQ
5678 A123 XYZ CQ
Please share some ideas,
Thanks a lot

with data as
  select 1234 as card_no, 'A123' as cust_no, 'XYZ' as address, 'CQ' as paymnt_mode from dual union all
  select 1234, 'A234', 'nmb', 'CC' from dual union all
  select 9876, 'B123', 'mnnjn', 'cc' from dual union all
  select 5678, 'A123', 'XYZ', 'CQ' from dual union all
  select 5678, 'A123', 'XYZ', 'CQ' from dual union all
  select 7876, 'Mk89', 'mku', 'CC' from dual
select card_no, cust_no, address, paymnt_mode
from
    select card_no, cust_no, address, paymnt_mode, count(*) over (partition by card_no) as cardinality
    from data
where cardinality > 1;
CARD_NO                CUST_NO ADDRESS PAYMNT_MODE
1234                   A123    XYZ     CQ         
1234                   A234    nmb     CC         
5678                   A123    XYZ     CQ         
5678                   A123    XYZ     CQ          Change the column list in the partition by clause if you want to check over other columns as well.

Similar Messages

  • Displaying metadata, how to display ONLY the Date

    I would like to display the Date below each image in Aperture 3. When I select "Date" in the Browser & Viewer Metadata window, the result is a very long string with the Date, the Time and the Time Zone. meaning that most of the time I see nothing because the string is much too long to be displayed...
    How to display ONLY the Date ?
    Thank you.
    Olivier

    om28 wrote:
    I will do that but still... if the Date could be ONLY the Date "without time and time zone", I would be able to display more information.. and it will look nicer.
    I said at the top of my first response above: +Afaik, there is no way within Aperture to change the date format of the date metadata overlay.+
    Send Aperture feedback to Apple via "Aperture→Provide Aperture Feedback"
    In the past I used Expression Media and the config for displaying such info was better.
    Aperture has a strange interface for it (and for other parameters), it does not behave at all like an Apple software (for the GUI), probably an external development team... but I agree it is more complex than iPhoto.
    Aperture is 10x more complex than iPhoto.
    If you want to see a rigid, boxed, "engineer"-style image database interface, take a look at Lightroom 3. It's a great program -- but it's a very different concept of information presentation and interaction.
    Thanks again.

  • Display only the last record per material in SAP query

    Hi,
    I have created a SAP Query using the quickviewer that is a join between 2 tables (MSEG and MKPF) that consist of material document information and date of posting.
    The results are fine however I would like only the last record per material to be displayed.
    Can anyone tell what do I need to add so for only the last record per material be displayed in the output.
    Thanks,
    Mark

    Hi Mark,
    May be if you use Control Level processing .........I think you will be able to get the result you want. Try displaying as Below,
    LOOP AT XXXXX.
    AT FIRST material.
    ENDAT.
    AT LAST material.
    *...Display what ever you want here. It will display at end of every material.
    ENDAT.
    ENDLOOP.
    Before using sort the table with key material in ascending.
    Hope what I had to say is helpful to you.
    Cheers,
    Raga Suman.

  • How make display only the amount field in table control(infotype 0008)

    Dear Freinds,
    have to make display only the amount field (Q0008-bet01) on table control in infotype 0008 , could you tell me how to make it display only.
    i have tried the below coding it is not working in PBO & PAI of the user exit
    ZXPADU01 and ZXPADU02. For the table control is there any othe method??
           loop at screen.
               screen-name  = 'WA_P0008-BET01'.
              screen-input = 0.
              screen-output = 1.
              modify screen.
          endloop.
    i have tried like this as well
           loop at screen.
               screen-name  = 'Q0008-BET01'.
              screen-input = 0.
              screen-output = 1.
              modify screen.
          endloop.
    in the both the above methods it is not working. Could any one plese suggest me how to make display only the amount field in infotype 0008.
    regards
    syamla

    Dear Freinds,
    have to make display only the amount field (Q0008-bet01) on table control in infotype 0008 , could you tell me how to make it display only.
    i have tried the below coding it is not working in PBO & PAI of the user exit
    ZXPADU01 and ZXPADU02. For the table control is there any othe method??
           loop at screen.
               screen-name  = 'WA_P0008-BET01'.
              screen-input = 0.
              screen-output = 1.
              modify screen.
          endloop.
    i have tried like this as well
           loop at screen.
               screen-name  = 'Q0008-BET01'.
              screen-input = 0.
              screen-output = 1.
              modify screen.
          endloop.
    in the both the above methods it is not working. Could any one plese suggest me how to make display only the amount field in infotype 0008.
    regards
    syamla

  • How to display only the description of a combobox.

    Hi All,
    I have a combobox on a grid.
    The value of it, is the adresses of BP.
    Example :
                                        string sQuery = "SELECT CRD1.Address FROM CRD1 WHERE CRD1.AdresType='S' AND CRD1.CardCode='" + oGrid.DataTable.Columns.Item("U_IFC_PP").Cells.Item(pVal.Row).Value.ToString() + "'";
                                        SAPbobsCOM.Recordset oRec;
                                        oRec = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                                        oRec.DoQuery(sQuery);
                                        SAPbouiCOM.ComboBoxColumn oCBB;
                                        oCBB = (SAPbouiCOM.ComboBoxColumn)oGrid.Columns.Item("U_IFC_ADR");
                                        while (!oRec.EoF)
                                            oCBB.ValidValues.Add(oRec.Fields.Item("Address").Value.ToString(), "");//, oRec.Fields.Item("Address").Value.ToString());
                                            oRec.MoveNext();
    When i click on the combobox, it's display the value and the description like this :
    value1 - Adr1
    value2 - Adr2
    i want to display only the description like the field "Ship To" in the folder "Logistics" in the Sales Order form.
    It is possible ?
    And what is the size limit of the parameter oCombobox.ValidValues.Add(ByVal Value As String, _
       ByVal Description As String _)
    Thanks for your response.
    Best Regards.
    Michael

    Hi Michael,
    actually you can't show only the description when you click into it.
    the lenght of the description is usually around 50.
    (but it depends also how long you made the value.)
    the best is to do it so:
    keep the value short with numbers
    and cut the description at 42 (to be on the safe side)
    lg David

  • Query needs display only the recent record that was updated into BW.

    Hi Gurus,
    I have a question related to query creation.
    I hve one Infoset which was built on top of Opportunities data and Activities data cubes.  Tthey are linked using Opportunity GUID.  And in the query I am displaying the Opportunity ID(from Opportunity cube),  Sales order Number from the Activities data and a keyfigure No of Doc headers from the opportunities cube.  Everything is fine.  I want to display One Opportunity ID and One Activity associated with it.  I mean I want to display only the activity ID which is very recent.  But the query displays all the activity IDs which are associated with the opportunity ID.   We are not using any time characteristics too as the query has to display all the data that is there in the cubeI just want to see the recent activity that has got updated into the cube.  Kindly advice on how to achieve this..
    THanks in Advance
    Mohan Kumar

    Hi mohan,
    try to do some restriction by using  request ID (0requid) and variable 0S_RQMRC (Most current data on 0requid).
    for example a restriction on activiy id by most current request ID.
    hope it helps.

  • How to edit only the selected record in Oracle forms 6i

    Hi,
    I have a form which has three control blocks.
    First block is for search criteria, The results in the second block are displayed based on the values entered in the first block. Second block is a multi record block.
    Below is my requirement:
    I want to edit the record in the second block, based on the cursor position.
    For EX: If the cursor is placed on the first record, all the fields in the first record should be in the editable mode.
                  If I move the cursor down, the next record should be editable and the previous record should again go back to non editable mode.
    I have tried using :system.cursor_record, but it's applying the editable property to all fields, irrespective of the cursor position.
    Any suggestions would be of great help.
    Thanks
    Deepthi

    Deepthi,
    Why would you need to do this...it seems unnecessary to me because your user can only edit the record they are physically at.  So, if your user is in record 3 he/she can't edit record 5.
    Now, to the specific issue you are having - if you are using the SET_ITEM_PROPERTY() built-in to make a record "Editable" then what you are seeing is expected results.  The SET_ITEM_PROPERTY() built-in affects ALL instances of a specific item.  If you need to set item instance specific properties then you need to use the SET_ITEM_INSTANCE_PROPERTY() built-in.  However, this built-in does not have the same set of properties that it can set.  Take a look at the Forms Help to compare these built-ins.
    If you must make each record editiable as your user navigates through them here is how I would attempt this.  I must reiterate however, I really don't think this is necessary...but I don't know your requirements .
    1.  Create a Forms parameter to caputure the CURRENT and PREVIOUS Record number.
    I prefer a parameter object over a Global because you can't choose the data type of a Global so you have to cast the value to accurately perform any numeric calculations on a Global.
    2.  Create/update When-New-Record-Instance trigger...
    /* Sample When-New-Record-Instance... */
    BEGIN
       :PARAMETER.Prev_Record := :PARAMETER.Curr_Record;
       :PARAMETER.Curr_Record := :SYSTEM.Trigger_Record;
       IF ( :PARAMETER.Prev_Record != :PARAMETER.Curr_Record) THEN
         -- Make the previous record the user was at Non-Editable...
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', INSERT_ALLOWED, PROPERTY_FALSE);
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', UPDATE_ALLOWED, PROPERTY_FALSE);
         -- You MUST do this for each of the items in the row of your multirecord block.  There is no built-in to set the properties
         -- all of the items in a row...
       END IF;
       -- Now make the current record editable...
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', INSERT_ALLOWED, PROPERTY_TRUE);
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- You MUST do this for each of the items in the row of your multirecord block.  There is no built-in to set the properties
         -- all of the items in a row...
    END;
    This sample code is untested and it meant to show you the logic, not the actual functioning code.
    Hope this helps.
    Craig...

  • How to get only the latest record in a folder

    Hi all,
    We have an OA SIT that is not a "standard" SIT in that it does not have the traditional Begin and End date. It only has an Effective date. Is there some way I can filter this table to only give me the latest record in the series? I know how to do this in SQL, but don't see how it would be possible in the EUL.
    We're trying to avoid creating database views, but at this point, I'm thinking it may be the easiest way to address this. Any other suggestions?
    Thanks in advance,
    Jewell

    Jewell.
    Of course I'm not going to mention that I have no idea what a 'standard' SIT is compared to your basic 'non-standard' SIT ... and I have to watch my spelling of such ... but however ...
    As you're most likely aware, in SQL you would get all the 'standard' SIT records first by going through the table. Then you'd go back through them all and find the most recent one.
    Because of this 2 table pass, I agree that just putting the SQL code in a custom folder (as you're not using views) would make the most sense.
    Russ

  • Display only the first record

    I have report in BEx where we want to find the first time a customer ordered Quantity of more than 500 in a data range (For Ex: From April 10 to April 30). In a particluar date range the customer may order more than once (Qty > 500). The catch is we want display only one first time he ordered qty > 500.
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
              4/22/2005        12,290 CA
              4/23/2005        4,826 CA
              4/26/2005        6,397 CA
              4/27/2005        1,538 CA
              4/28/2005        4,849 CA
    XYZ         4/25/2005        2,000 CA
              4/26/2005        12,000 CA
              4/27/2005        4,500 CA
              4/28/2005        6,300 CA
    In the output report we want to display the first record for each customer as:
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
    XYZ         4/25/2005        2,000 CA
    Your help is really appreciated. Thanks.

    jayant,
    i think, you could use your date as a condition to filter by in your report... try looking that the properties of your KF and, under Calculations, set the 'Calculate Result as...' to the first value only.
    hope this helps - don't forget to give out points. =)
    ryan.
    ps. i've tried this, and it sort of works - just need a bit more of tweaking around. =)
    Message was edited by: Ryan Kristoffer Tan

  • How to populate only the first record by default when the page opens?

    Dear Members,
    I am using OAF R12 and my requirement is as follows:-
    When the user opens the custom OAF R12 page, I just want to query the first record from the underlying VO.
    For example, If the table has 10 rows, I just want to query the first row as soon as the page opens.
    I have written the below code:-
    Process Request Method of the CO:-_
    am.invokeMethod("initHeaders");
    Code in AM_
    public void initHeaders()
    HeadersVOImpl hVO = getHeadersVO1();
    hVO.initQueryHeaders();
    Code in VO_
    public void initQueryHeaders()
    executeQuery();
    As it is very clear that with the above code all the records will be queried. I have to add something before the executeQuery() method in the VO to just query the first record.
    Can any one please help me by guiding me what I should add before the executeQuery() method in the VO?
    Many thanks in advance.
    Regards,
    R4S.

    Hello Gyan,
    Many thanks for your reply.
    The below line in your code is throwing incompatible type error:
    OARow row = vo.first();
    Can you please help me.
    Regards,
    R4S

  • PSE6 Organizer... How to display only the hidden pics

    Since deleting bad pics is very slow in my PC, in PSE5 I began using an alternate method; I hit Alt-F2 to hide unwanted pics and then selected the Hidden tag, selected all the pics and deleted them all in one batch. But now in PSE6 there is no Hidden tag! (at least I have not found it).
    Is there a way in PSE6 to apply some sort of filter to ONLY display hidden pics?

    See http://www.adobeforums.com/webx?14@@.3c05ca57/0 .

  • Stop processing the duplicate record values

    Hi Experts,
       I have a requirement that i need do not process the duplicate values from the file place in FTP.
    Scenerio is File->PI->RFC.
    For ex:
    Source Data:
          Name,Emp_id,DOB,Designation,Location,Joining_Date,Time_Stamp
          Moni,654654,11-09-1980,Developer,TN,20-02-2008,24-03-2014:3.38pm
          Shiva,654612,21-02-1982,Developer,TN,15-08-2009,24-03-2014:3.38pm
          Venkat,654655,19-01-1983,Developer,TN,28-10-2010,24-03-2014:3.38pm
          Moni,654654,11-09-1980,Developer,TN,20-02-2008,24-03-2014:9.38pm
    If next time the same record comes like Moni,654654,11-09-1980,Developer,TN,20-02-2008,24-03-2014:9.38pm,no need to process this record values.
    How to stop processing the duplicate record.Kindly share some ideas to achieve this requirement by using PI 7.1.
    Best Regards,
    Monikandan.

    Hi ,
    Here is one of the clean sol:
    1)Using FCC read record by record by giving end separator as newline in FCC.
    Reading a delimeter separated file whose columns may jumble
    2)Use two mapping in one operation mapping .
    1st Mapping :
    Sourcefield()-->sort(ascending)-->splitbyvalue(valuechange)-->eachvalue-->collapsecontext-->udf-->
    splitbyvalue(eachvalue)-->map to all target fields
    Keep context of source field to top node to come all values in single array
    for(int i=0;i<input.length;i++){
    String temp[] = input[i].split(",");
    if(temp.length == 7)
    Name.addValue(temp[0]) ;
    Emp_id.addValue(temp[1]) ;
    DOB.addValue(temp[2]) ;
    Designation.addValue(temp[3]) ;
    Location.addValue(temp[4]) ;
    Joining_Date.addValue(temp[5]) ;
    Time_Stamp.addValue(temp[6]) ;
    else{throw new  StreamTransformationException("field missing in col "+i)}// up to you
    Mapping 2:Actual file structure to RFC
    Regards
    Venkat

  • 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

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • 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

Maybe you are looking for

  • Error while loading new trx types to a new OU

    Steps to reproduce: Please note, source and target instance are same here 1. Assume X is the existing OU, and Y is the new OU setup at basic level 2. Dowloaded Receivables trx types data as an extract for OU = X 3. Modified the xml file to point it t

  • How do I add a PDF to a combined file

    I'm having difficulty combining files and keep getting an error message that doesn't save my combined file once complete ... are the pdfs to large?

  • J2EE engine version information

    I am trying to find out what version of J2EE SAP's Web AS adheres to.  The last I heard was that it adhered to 1.3 but I came across a weblog which stated that it adheres to 1.4.  I know the JRE is 1.4.2 and this would seem to confirm that SAP adhere

  • Imovie 08 glitches - can't select/edit/or modify clips with

    I have used imovie 08 for multiple projects with no problems. My HD has plenty of space, and imovie is the only application open. I can download video and audio from a camera in the events pane. Here are the problems: 1. Can skim the event video, but

  • User Exit for RFQ

    Hi, I want to know the User Exit used in the RFQ while saving or during input or change of the RFQ quantity. actually i need to check if the RFQ is created with reference to PR, then it should not exceed the PR Quantity. So to trigger the message, i