Show duplicate lines times

Dear members,

Lets assume that we have data as below:
Receipt number      txn date      Item Number            com batch        gain      locator
---------------------------------------------------------------------------------------------------------------
134565                15/05/2011      710                   230             20        L123
178907                20/05/2011      710                   230             20        L123
253535                19/05/2011      710                   450             70        L456
983636                05/05/2011      710                   345             60        L721
I needed to write a query so that the result should be:
Receipt number      txn date      Item Number             com batch        gain      locator
---------------------------------------------------------------------------------------------------------------
134565                15/05/2011      710                   230             20        L123
178907                20/05/2011      710        
253535                19/05/2011      710                   450             70        L456
983636                05/05/2011      710                   345             60        L721          
Of the foregoing for 710 point, we have two numbers for which we same in the columns of data * 'batch com', gain, index *. So I need to write a query in such a way so that the data for the three columns if same should appear only once as stated above.


I don't get clues on how to do it.

Any ideas?

Thank you
Sandeep

You can try like this,

Not tested!

SELECT reciept_number,
       txn_date,
       item_number,
       DECODE (rn, 1, com_batch) com_batch,
       DECODE (rn, 1, gain) gain,
       DECODE (rn, 1, LOCATOR) LOCATOR
  FROM (SELECT A.*, ROW_NUMBER () OVER (PARTITION BY item_number, com_batch, gain, LOCATOR ORDER BY txn_date) rn
          FROM table_name A)

G.

Tags: Database

Similar Questions

  • How not to show duplicate lines, based on a field

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0

    Hello

    I have a query that looks like some scripts that did not stand on a given date compared to what ran the same day about a week ago. We want to include the start_datetime and the end_datetime but when I add it to the select statement, it evokes all instances of jobs that run several times during the day. Is it possible to exclude the extra lines based on the field of script_name?
    SELECT instances.script_name, 
                             instances.instance_name, 
                             REGEXP_REPLACE(master.description, 
                                            chr(49814),  -- em-dash
                                            '-') description
                                            --instances.start_datetime
                      FROM   xxcar.xxcar_abat_instances Instances,
                             xxcar.xxcar_abatch_master  Master
                      WHERE  1 = 1
                      AND    TRUNC(start_datetime) = TRUNC(TO_DATE(:p_StartDate, 'YYYY/MM/DD HH24:MI:SS')) - (:p_NumOfWeeks * 7)
                      AND    Instances.SCRIPT_NAME = Master.SCRIPT_NAME (+)
                      MINUS
                      SELECT script_name, 
                             instance_name, 
                             NULL
                             --NULL
                      FROM   xxcar.xxcar_abat_instances 
                      WHERE  1 = 1
                      AND    TRUNC(start_datetime) = TRUNC(TO_DATE(:p_StartDate, 'YYYY/MM/DD HH24:MI:SS'))

    LESS performs a set operation - remove lines from the first series that exactly match the second set.
    When you add columns to the first series, you want a smaller filter - try a NOT IN multi-column:
    To remove several courses, to regroup and get min/max

    SELECT instances.script_name,
                             instances.instance_name,
                             REGEXP_REPLACE(master.description,
                                            chr(49814),  -- em-dash
                                            '-') description,
                             min(instances.start_datetime) start_datetime,
                             min(instances.end_datetime) end_datetime
                      FROM   xxcar.xxcar_abat_instances Instances,
                             xxcar.xxcar_abatch_master  Master
                      WHERE  1 = 1
                      AND    TRUNC(start_datetime) = TRUNC(TO_DATE(:p_StartDate, 'YYYY/MM/DD HH24:MI:SS')) - (:p_NumOfWeeks * 7)
                      AND    Instances.SCRIPT_NAME = Master.SCRIPT_NAME (+)
                      AND (script_name, instance_name) NOT IN
                    ( SELECT script_name,
                             instance_name
                      FROM   xxcar.xxcar_abat_instances
                      WHERE  1 = 1
                      AND    TRUNC(start_datetime) = TRUNC(TO_DATE(:p_StartDate, 'YYYY/MM/DD HH24:MI:SS'))
                    )
    group by instances.script_name, instances.instance_name, master.description
    

    You do not give the definitions of table and query schemas in him, therefore I don't test it.

    Kind regards
    David

  • Anyone know where the option 'Show duplicates' disappeared? I can't find it in iTunes 12.4 :(

    Just like the topic...

    I have a large music library, but unfortunately contains many duplicates that I move slowly deleting. 12.4 installed and the option has disappeared from the view tab.

    No idea where it is, or has it been removed?

    It has been moved to the file > library menu.

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use display > show duplicate items (pre iTunes 12.4) or file > library > show duplicate items (post 12.4) then click on Same Album to display exact duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • change the size of the table and remove the duplicate line

    Hello

    I run a program that does a for loop 3 times.  In each loop, the data are collected for x and y points (10 in this example).  How can I output the table with 30 points in a simple 2D array (size 2 x 30)?

    Moreover, from the table, how to delete duplicate rows that contain the same value of x?

    Thank you

    hiNi.

    He probaibly which would have allowed to attach a file that has a consecutive duplicate lines.

    Here is a simple solution.

  • The Oracle answers and duplicate lines

    Hello


    I have a SQL view called "DUP" which shows all lines that are the same
    for the 4 main fields INCNUM, TAKE, SAMP, CORR.
    Now there are a few lines that are duplicates, whereas these 4 key column, BUT
    There are also lines that are duplicates of 100%.

    The Oracle answers seems to hide lines that are 100% (all columns, not only 4) duplicates. (there no SEPARATE in SQL).
    How can I avoid this behavior?

    Also how to create whole new second report showing 100% duplicates lines i.e.
    who are the same for each unique column?

    Thank you
    metalray

    You just have to do the reverse then. Uncheck the separate support feature in the RPD and you will separate in your SQL

    Thank you
    Prash

  • Show duplicates no longer Option iTunes 12.4

    iTunes recently updated to 12.4.0.119 interface and now the "Show duplicates" option is no longer available.

    So far, if I've highlighted the DISPLAY bar I could scroll down to DISPLAY the DUPLICATES and doubled in my iTunes database files would be visible.
    I have a lot of files in my iTunes and tried to eliminate disk space on my computer. I have also a large number of duplicate files because after that I updated from a Windows based machine to the iMac, I imported all my old backups and of course it automatically filled all my music in iTunes. This is great, but now I have more than 30,000 music files in my iTunes. I'm sure I have only 15,000 or so unique song files and I want to eliminate the surplus.

    So my question now should be obvious: How can I view my files duplicates in iTunes 12.4?

    I'm operating an iMac running El Capitan 10.11.5.

    Sincerely,

    Music lover frustrated

    Have you think about 'My music' select file > library > show duplicate items

  • Windows 10 shows a bad time in boot camp

    Windows 10 shows the wrong time. It is a big problem because it my ability to connect to some programs that I regularly use the effects. Even if I went into the Windows settings and set the Windows system clock to EASTERN time is 7 to 8 hours off the coast. I tried parameter, the parameters of time automatically detect and then turn off automatically detect with no joy.

    I heard that this happens because Apple uses GMT and Windows uses another method. I really need this to work.

    Someone at - he found a solution for this?

    OS X shows the exact time? If this is the case, change your source Windows time to be identical to the source of Apple, which is usually time.apple.com site or the use of the public NTP servers for the two operating systems.

    If you connect to a Windows domain/AD server, make sure that you have a good VPN or local connection to such a server.

  • My verse ATT modem (non apple devices to use this modem} is connected to the ATT line, Time Capsule (iPhones, Macs Time Capsule use) via ethernet Uverse.) Non apple devices can collect data from iPhones or Mac using the time Capsule?

    My verse ATT modem ({use of devices not apple wifi of this modem} is connected to the ATT line, Time Capsule (iPhones, Macs use the wifi of the time Capsule) and connect to the Uverse modem via ethernet.)

    Both devices are set to the highest security and each uses separate passwords.

    Non apple devices can collect data from iPhones or Mac using the time Capsule?

    With a bit of work by someone who knows how to do such things, not Apple computers could read some files on the Mac if file sharing is configured on the network... devices non-Apple and... He knew the device passwords or administrator for Macs.

    Mac could also play the files on other Macs if file sharing has been implemented and the device password or admin was known.

    If you ask if a PC can read the files on the Time Capsule, the answer is Yes, without doubt, assuming that the PC knew the password of device for the time Capsule.

  • I want that the to-do bar to show all the time

    When I use MS Word on my Macbook (OS X El Capitan 10.11.3), and I'm going to full screen by pressing the green button, I do not see the taskbar (the thing that says "file, edit, view," etc.) at the top of the screen.  It's a real problem for me because I write in several languages and regularly switch between different keyboards. to change keyboards, you must click an icon in the taskbar. So to move from a keyboard English, German or Spanish when you type in the Word doc, I have to first, click on the green button to make the smallest word doc, change the keyboard by clicking on the change of keyboard icon on the taskbar (that's a flag US for American English) and then click on the green button to make the Word doc full screen. Here are the three steps instead of one. I want to have the taskbar visible even when the Word doc is completely open, or to spend sort button that controls change the keyboard to another location on the screen.  Can we do anything?  BTW, I'm very new to Mac (always PC user before two weeks ago) so I'm still a little confused.

    This is the menu bar. If you use the full screen then you cannot have show all the time.

    Just expand the window in the image of the screen and you can display the menu bar.

    Also, you don't have to leave it full screen to see the menu bar. Simply move the cursor to the top of the screen.

    Or, you can configure a shortcut in the keyboard system preferences to switch between input sources. By default, it was cmd-space, but who has been co-opted by Spotlight. You can set it to what is convenient and not used. Then, you won't have to go in the status menu.

  • Why my iPhone showing the wrong time zone?

    Why my iPhone showing the wrong time zone when it is set to automatic? When I put it manually, it is fine. Is this a bug in the iOS 9?

    Try to activate your iPhone location service before

  • HP Officejet 4630e all in one: the time on my printer display shows the wrong time

    The clock on the display shows the wrong time.  Does anyone know how to rectify this please.

    Hello

    The date and time settings would cause problems of synchronization with Eprint if incorrect. The date and time should be accessible from the Preferences menu.

    Try this

    Power reset

    1. Without putting off the product, disconnect the power cord from the back of the product.
    2. Wait 30 seconds and then plug the power cord into the back of the product.
    3. If the product is not already on, press the power button to turn it on.

    Now, try to change the date and time and check.

    Where this fails, try this

    Setup > tools > restore defaults

    Try to set the date and time of return

    NOTE: This will remove network also settings so you need to redo the configuration of the network

    Measures to restore the network configuration

    http://support.HP.com/us-en/document/c03834108

    Although I am an employee of HP, I speak for myself and not for HP.

    Click on the thumb BRAVO upwards on the left to say 'thank you '.

    Make it easier for others to find solutions by checking a response "Accept as Solution" if it solves your problem.

  • When I'm signed Windows Live, my screen shows two lines and when I type my name and password I can't see them.

    When I sign live Windows my screen only showed when I type my name and passoword and lines I can't see them, and yet it opens to my email. What happens and how can I fix.  Also on some Microsoft sites, I can also not read the page it is blanck and only a few show blue lines but no words. Help I know not if I maybe downloaded somethng but need to read websites and I can't.  I went on the essential Microsoft website to download and I can see a picture but no words.

    Hi Marlene,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

     

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • Why doesn't my itunes file drop-down 'show duplicates '?

    Why doesn't my itunes file drop-down 'show duplicates '?

    Support for products Apple is located in the Apple Forums:
    https://discussions.Apple.com/index.jspa

  • Win 8 the Action Center Maintenance flag shows all the time.

    Hi, I just upgraded to Windows 8, and so far, everything is good, except that I noticed that the Maintenance indicator shows all the time in the taskbar. It started yesterday, previously only proven while in fact the interview. How can I fix it?

    Why don't you just open control panel... icons in notification area and choose for the "notifications action center 'flag' to see the only?

  • do a form filling to the top but its still showing red line and documents may not be validated pleaze tel me how to solve?

    make a form to complete but its still showing red line and documents cannot be posted as me please how to fix?
    ]

    Hi Nithya,

    Please specify what you're trying to do and what is the error you receive. If possible, share a screenshot of the error with the red lines.

    In addition, please share the following details: -.

    Version of Adobe Reader: -.

    Version of the operating system (Windows/MAC): -.

    Thank you

    Tanvi

Maybe you are looking for

  • Where to find the keyboard for my Satellite Pro U300 13F?

    I accidentally distroyed my keyboard with wine? Who can give me a hint where to buy a replacement keyboard or a secondary market?The type of my laptop is: U300 13F p/n PSU31E-00X012DU Your advice, please, keesl

  • Old Instrument NOR Simulator

    Hi all. I have an OLD NI instrument Simulator. It is so old, that I'm not still able to use the NI instrument Simulator Wizard. I called for the support and the technician was more useful however, whenever I run the wizard, it opens and alarm that re

  • Rundll. The specified module could not be found. Download error.

    Hi, during downloading, I get the same error message: as the rundll module not found. What should I do to remedy this situation? Win Vista Ultimate-, 64-bit OS. SP2, IE9. [Moved from comments]

  • BlackBerry Blackberry Z10 close

    Help! My BBz10 has entered an endless loop of recovery by the "red light coming on, THE Blackberry, the logo is displayed, dead battery signal, stop, back displays the logo of bb, stops, turns on, displays bb logo, OS til 53%, load stops and continue

  • ListField: setCallback is not necessary?

    OK, this surprised me. I've implemented a ListField subclass that implements ListFieldCallback. Due to an oversight, I forgot to add setCallback (this) in my subclass constructor. However, it works very well! The debugger shows that each instance is