How to avoid duplication

I am facing a problem, put out the query must be such that it should return an a.claim_no (he is core_business.cb_pensioner a PK), where as it is returned from the claim_no in duplicate.
This is data of old age pensioners, it takes account of every retiree with respective information.
I'll be v thank full for your advice.

SELECT a.claim_no,  a.NAME,  a.old_nic_no,  a.new_nic_no,
             LPAD (ip_region_fo_code, 4, 0) || ip_check_digit || LPAD (ip_serial_no, 6, 0)   AS eobi_no,
          rate_change_date,    pension_amount,   a.bank_code ,c.name bank_name ,  a.branch_code, B.ADDRESS,  b.name branch_name, d.name branch_city,date_of_birth,  a. region_fo_code
     FROM core_business.cb_pensioner a, 
     general_information.cb_branch b,
     general_information.cb_bank c,
     general_information.cb_city d
    WHERE    a. status = 'A' 
          AND SUBSTR (claim_no, 3, 1) <> 'S'
          AND (old_nic_no IS NOT NULL OR new_nic_no IS NOT NULL)
          AND SUBSTR (old_nic_no, 1, 3) <> '000'
          AND SUBSTR (old_nic_no, 8, 6) <> '000000'
          AND SUBSTR (old_nic_no, 8, 6) <> '101010'
         /* AND a.bank_code = 3
          AND EXISTS
                 (SELECT NULL
                    FROM general_information.cb_branch b
                   WHERE a.bank_code = b.bank_code
                         AND a.branch_code = b.branch_code)*/ 
                         and a.bank_code = c.bank_code 
                         and a.branch_code = b.branch_code
                         and b.city_code = d.city_code;

Hello

then the general table of duplicates. What I sometimes do, is to include the ROWID from all of the tables (a.rowid, b.rowid, c.rowid, d.rowid). If you find records where the main table has the same ROWID, but one of the other tables so you know what are the tables gives you the duplicate lines. With the row ID (or PK), you can find out why you have duplicates. Maybe in the paintings of general_information data have a time factor, so there may be duplicate codes.

Herald tiomela
http://htendam.WordPress.com

Tags: Database

Similar Questions

  • How to avoid duplication of work, making a calculated AMOUNT field

    Hi, I am trying to solve this problem;
    In my DataSet (in a custom Admin folder), I have a list of tickets (with certain attributes), and some of them are duplicated:

    For example
    Ticket_id     Group_id             Ticket_date                Resource_name          Ticket_status       

    5416          100000401       10/12/2007 7:10:31 am                Mr. A                 2
    5416          100000401       9/1/2008 11:00:44 pm                 Mr. A                 2
    57381         100000401       27/12/2007 11:37:11 am               Mr. A                 2
    57381         100000401       15/1/2008 9:33:12 am                 Mr. A                 2
    I want this duplication because I need it when I filter the dataset (using the Ticket_date) with two parameters:

    Ticket_date between lower_limit_date and upper_limit_date

    Then, inside the report, ticket number, if I take 2 files with the same ticket_id, I have a calculated field when I use the COUNT_DISTINCT and for each pair of tickets, that the meter is always = 1; in this way (in the report), I have the following fields:
    Group_id           Count_tickects   Resource_name   

    100000401              2                    Mr. A                
    It's OK!

    Now, if I want to count how many tickets have status = 2 (this means that they are closed), I want to get 2 and NO 4

    I tried to use this calculation (tickets closed): SUM (CASE WHEN "Report #7 COMPLETE tickets". State Id ticket = 2 THEN 1 0 OTHERWISE END)
    but I've always had the result of 4... and this does not, because the tickets are only 2...
    I also tried to use an analytical function by using the PARTITION BY, but did not get the correct result

    In other words, I want to achieve this goal:
    Group_id           Count_tickects   Tickets Closed     Resource_name

    100000401              2                     2             Mr.A
    Any help will be appreciated

    Alex

    Hello

    Why did you put in ELSE 0? You count 0s. If you omit the ELSE then you count only 1s.

    Try COUNT_DISTINCT (BOX WHEN Ticket Status Id = 2 THEN ticket_id END) like in my previous thread.

    Rod West

  • How to avoid duplication in the title?

    I have a video of five minutes with a title of general text / by default at the beginning and at the end. When I change the text in the opening title, the text in the title of fence is replaced by this same text. When I change the closing title text, this edition is recalled in the opening title. How can I change the text in a title so that it does not change the text in the other title?

    I tried this edit title several times. It always happens in the same way. I want the opening title to say one thing and the closing title to say to each other.

    This article goes into detail, and contains links to some useful articles of titration: http://forums.adobe.com/message/5563721#5563721

    Good luck

    Hunt

  • How to avoid duplication of the menu (in css) elements of the Apex?

    Hi all

    I used the css template to say Menu (admin manager, Manager of symbol, the price to the model), I also have a drop point say "category" in the application. now, wat happens is... When I place the mouse on the choice of selection if it displays but the overlapps the item (category) the choice of the menu... bocz of this I am unable to see the menu?

    How can I display the Menu correctly?

    I used the Z-index: 1 for the Menu... then also no change or reflectd...


    Please help me!



    David

    Hello

    OK - you can then switch the drop-down list in your mclose() function - this function include:

    $x('P1_LIST_ITEM_NAME').style.display = 'block';
    

    Andy

  • I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I think they mean JavaScript.

    In your Safari menu bar, click Safari > Preferences and then select the Security tab, and then select: Enable JavaScript

  • How to avoid the u letter when you type ' u?

    Hello community,

    I need to write ' u , but it automatically replaces these two letters by u on selection of keyboard we International PC.

    Can you suggest me how to avoid it?

    Thanks in advance,

    Gomez

    What exact keystrokes you type?

  • with 2 windows open, if I zoomed in Windows Active, expanded as this one. How to avoid this?

    Conditions:
    2 windows of firefox open 21.0, showing 2 different pages, which comes from the same server.
    One of the 2 pages it active, having shot on it with the mouse.
    If I try to zoom on active windows, is enlarged also another one that is not active.
    How to avoid this?

    Hello AngB, what you described is the expected behavior by default in firefox, since it will remember your custom of expansion on a per domain basis and apply it to every page of this area.

    If you want to change it, enter about: config in the address bar of firefox (confirmed the message information where it appears) and look for the named browser.zoom.siteSpecificpreference. Double-click it and change its value to false.

  • Satellite Pro 4200 how to avoid the mistakes of the ACPI

    Satellite Pro 4200 how to avoid the ACPI errors after installing SP2 for windows XP Prof
    The problem is that my computer after installation service Pack 2 need about 15 minutes from time of shoutdown - what should I do to avoid this problem.
    Piotr Plecke

    Hello
    in this case it would be interesting what Type of laptop it is exactly.

    You will find this model on the bottom of your laptop. There is a review of it.

    Some models have a Bios update available, others not, for example.

    Please send additional information!

    Good bye

  • How to avoid accidentally getting the split screen. I never want that. 3.6.11 version. Thank you

    I don't know how I did it, but now when I go to drag a web page below on the right scroll bar another mini bar appears. If I accidentally hit that all of a sudden I have two pages to the top at the same time and I can't get back to where I was without closing the page entirely.

    How to avoid this? I rarely want to two pages at the same time.

    Thank you

    This isn't a feature built into Firefox. You have an add-on like Fox Splitter installed? This one seems to do what you describe.

  • My iPad detects inactivity while I'm listening to a story.  Then he slips into the mode "sleep" and interrupts the story.  Any suggestions on how to avoid this?

    My iPad detects inactivity while I'm listening to a story.  Then he slips into the mode "sleep" and interrupts the story.  Any suggestions on how to avoid this?

    Setting to never by using the auto-lock settings application.

    Settings > general > auto lock > never

  • Camileo S10 - how to avoid the 'information' during video playback on TV

    I just received my Camileo S10... very nice indeed... but how to avoid the track and reading data to be shown on the screen during playback on my TV...?

    Go to the movies, then before you start playing click the OK button. This also works when you save. You must do this before playing or recording.

  • How to avoid Photos

    How to avoid the Photos and not the transfer of the app and open it that my images directly from my camera? My brother is trying to avoid the picture and just get the pictures from his camera on his hard drive. But the Photo does not seem to give him an opportunity to transfer just to a location of his choice. He dislikes do not have control and do not like the Photo App.

    Use the Image Capture to import photos from your camera.  Image capture will allow you to transfer the photos to a folder of your choice.

    To stop the pictures of the opening when you insert the card, select the map in the sidebar of pictures and clear the check mark 'open pictures... '. ».

  • Print last page blank, how to avoid the last page to print, using NiReport

    Hi all

    I use NIReport to generate report/Print.

    I have problem

    I have a page to print,

    I wrote until the last line

    Problem is that NEITHER report adds a new, blank page, which is not necessary.

    This problem n, t occur when we write in the last row or left white.

    Note: I also have a header and footer details

    It will be printed on the blank page.

    When NIReport understand specific text is last line of the page, then NIReport automatically add the new page in the template.

    How to avoid printing the last white page in NIReport?

    Thank you

    Mukesh Kumar

    Just a guess: you use AppendLine? If so, you can try to move on AppendText to write the line, adding of newline as the first call when you need to start a new line. AppendLine adds a new line to the report after printing the line, and this can generate a blank page if you write to the last line on the page.

  • How to avoid the launch of Labview VI when he invokes in Teststand environment?

    Hi, friends.

    I am a student of teststand. I wrote a few screws by Labview. Now, I want to invoke in teststand environment.

    But when I run the sequence. LabVIEW automatically launches.

    How to avoid the launch of Labview when I run the sequence?

    Thank you.

    LabVIEW programs require a runtime engine. Under the TestStand configuration drop-down, select adapters. You can change the LabVIEW adapter to select the runtime rather than the development system.

    This should prevent the main screen of LabVIEW to appear, but you will not be able to change your LabVIEW VIs while they run of TestStand using the runtime engine.

  • How to avoid the DPP transfer CR2 on desktop

    Hello

    Please if you can help me;

    My OS-> XP pro SP3
    My PLR-> version 3.14.15

    When I drag an image (size cr2) DPP automatically, it is transferred to
    screen area.

    How to avoid this?

    Import your images into the folder you want first, and then use PLR for access to this folder and from there we can work better. Otherwise, on DPP to start, choose a different folder of office (on the left, you may need to toggle the DISPLAY of RECORDS).

Maybe you are looking for