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
I want this duplication because I need it when I filter the dataset (using the Ticket_date) with two parameters:
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
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
It's OK!
100000401 2 Mr. A
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
Any help will be appreciated
100000401 2 2 Mr.A
AlexHello
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!
DavidHello
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 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?
-
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 PleckeHello
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
-
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?
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 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.15When 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
-
Time Machine: When can I delete?
Time Machine seems to be considered as unlimited external HARD drive... I started using TM a few months previously and made my drive external HARD quickly became crowded. My understanding is that TM will be in safeguarding the principle that what has
-
login to 74.50.117.107 appears in firefox at the bottom right or bottom left of the screen as a text overlay when I go to the home page of google.ca why? Google search so that it is not much help.
-
Can I save a file datalog in LV format 7.1 of a program written in BT 8.2?
I have a program I wrote there in LabVIEW 7.1 years. He used inspection data in a file datalog. I do a new programming in LabVIEW 8.2 who needs to write files of control that can be used by software version 7.1. I do not have access to change the
-
I'm unable to access the internet with my CV due to the reception of the following - xp Antispyware 2011 alert. How can it be deleted? I have McAfee Total Protection Plus, but which apparently does not work. Help, please.This problem existed for a
-
Need to do system restore in Vista, but don't have no restore disks
Have lost my windows vista boot floppies, need to do a reboot complete sytems any ideas? * original title - lost drive *.