Please, help me to by merging the same id assining people
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit ProductionPlease help me
We_addr_id defines the Address.
We_pid Defines the Person.
i am planning to merge the same person together by assigining the same we_pid.
WITH merge_names AS (SELECT 1000 We_pid,
999898989 We_addr_id,
'DONALD' first_name,
'BOATRIGHT' last_name,
'L' middle_name,
NULL Suffix FROM DUAL
UNION ALL
SELECT 1001 We_pid,
999898989 We_addr_id,
'DONALD' first_name,
'BOATRIGHT' last_name,
'LARRY' middle_name,
NULL Suffix
FROM DUAL
UNION ALL
SELECT 1002 We_pid,
999898989 We_addr_id,
'DONALD' first_name,
'BOATRIGHT' last_name,
NULL middle_name,
NULL Suffix
FROM DUAL
UNION ALL
SELECT 33065 WE_PID,
99000000 We_addr_id,
'LUNA' First_name,
'JOSE' last_name,
NULL middle_name,
NULL suffix
FROM DUAL
UNION ALL
SELECT 8450527 WE_PID_LINK,
99000000 We_addr_id,
'LUNA' First_name,
'JOSE' last_name,
'A' middle_name,
NULL suffix
FROM DUAL
UNION ALL
SELECT 373453429 WE_PID_LINK,
99000000 We_addr_id,
'LUNA' First_name,
'JOSE' last_name,
NULL middle_name,
NULL suffix
FROM DUAL
UNION ALL
SELECT 442303062 WE_PID,
99000000 We_addr_id,
'LUNA' First_name,
'JOSE' last_name,
'S' middle_name,
NULL suffix
FROM DUAL
UNION ALL
SELECT 30088775765 WE_PID,
990000878 We_addr_id,
'BILL' last_name,
'RAY' first_name,
'M' middle_name,
NULL SUFFIX
FROM DUAL
UNION ALL
SELECT 30088775766 WE_PID,
990000878 We_addr_id,
'RAY' first_name,
'BILL' last_name,
NULL middle_name,
NULL SUFFIX
FROM DUAL
UNION ALL
SELECT 30088775767 WE_PID,
990000878 We_addr_id,
'RAY' first_name,
'BILL' last_name,
'MAX' middle_name,
NULL SUFFIX
FROM DUAL
UNION ALL
SELECT 30088775768 WE_PID,
990000878 We_addr_id,
'RAY' first_name,
'BILL' last_name,
'MICHEL' middle_name,
NULL SUffix
FROM DUAL
UNION ALL
SELECT 399998776 WE_PID,
9901111 We_addr_id,
'ELLISON' first_name,
'LAWRANCE' last_name,
NULL middle_name,
NULL SUFFIX
FROM DUAL
UNION ALL
SELECT 399998777 WE_PID,
9901111 We_addr_id,
'ELLISON' first_name,
'LAWRANCE' last_name,
'J' middle_name,
'JR' SUFFIX
FROM DUAL
UNION ALL
SELECT 399998778 WE_PID,
9901111 We_addr_id,
'ELLISON' first_name,
'LAWRANCE' last_name,
'JAMES' middle_name,
'SR' SUFFIX
FROM DUAL
UNION ALL
SELECT 399998779 WE_PID,
9901111 We_addr_id,
'ELLISON' first_name,
'LAWRANCE' last_name,
'JACK' middle_name,
'JR' SUFFIX
FROM DUAL)
SELECT *
FROM merge_names
o/p Required
WE_PID WE_ADDR_ID FIRST_NAME LAST_NAME MIDDLE_NAME SUFFIX MERGE_WEPID
1000 999898989 DONALD BOATRIGHT L 1000
1001 999898989 DONALD BOATRIGHT LARRY 1000
1002 999898989 DONALD BOATRIGHT 1000
33065 99000000 LUNA JOSE 33065
8450527 99000000 LUNA JOSE A 8450527
373453429 99000000 LUNA JOSE 33065
442303062 99000000 LUNA JOSE S 442303062
30088775765 990000878 BILL RAY M 30088775765
30088775766 990000878 RAY BILL 30088775766
30088775767 990000878 RAY BILL MAX 30088775767
30088775768 990000878 RAY BILL MICHEL 30088775768
399998776 9901111 ELLISON LAWRANCE 399998776
399998777 9901111 ELLISON LAWRANCE J JR 399998777
399998778 9901111 ELLISON LAWRANCE JAMES SR 399998778
399998779 9901111 ELLISON LAWRANCE JACK JR 399998777
Thank you
Hello
Interesting problem!
That's what you asked for:
WITH got_min_we_pid AS
(
SELECT merge_names.*
, MIN (we_pid) OVER ( PARTITION BY first_name
, last_name
, middle_name
, suffix
) AS min_we_pid
FROM merge_names
)
, possible_matches AS
(
SELECT CONNECT_BY_ROOT min_we_pid AS min_we_pid
, we_pid AS leaf_we_pid
FROM got_min_we_pid
WHERE CONNECT_BY_ISLEAF = 1
START WITH we_pid = min_we_pid
CONNECT BY first_name = PRIOR first_name
AND last_name = PRIOR last_name
AND SUBSTR ( 'x' || middle_name
, 1
, LENGTH ('x' || PRIOR middle_name)
) = 'x' || PRIOR middle_name
AND 'x' || middle_name > 'x' || PRIOR middle_name
AND 'x' || suffix = 'x' || PRIOR suffix
)
, got_match_cnt AS
(
SELECT DISTINCT
min_we_pid
, leaf_we_pid
, COUNT (DISTINCT leaf_we_pid) OVER (PARTITION BY min_we_pid) AS match_cnt
FROM possible_matches
)
SELECT c.*
, NVL (p.leaf_we_pid, c.min_we_pid) AS merge_wepid
FROM GOT_MIN_we_pid c
LEFT OUTER JOIN got_match_cnt p ON p.min_we_pid = c.min_we_pid
AND p.match_cnt = 1
ORDER BY c.last_name
, c.first_name
, c.middle_name
;
Here's how it works:
First of all, we take care of the exact replica, by finding the we_pid lowest for each group defined by (first_name, last_name, middle_name, suffix). For example, the two lines for Jose Luna (no middle name) are assigned to the min_we_pid = 33065. It is this min_we_pid, not the original we_pid, that is used in all future operations.
Then we are all names other names that are similar, but more comprehensive, using a CONNECT BY (subquery possible_matches) query. The parents in this query are stored with short middle_names, and children are lines that have first_name, last_name identical and suffix, but middle_names longer. I concatenated the x at the beginning of all middle_names for comparisons, to treat the NULL as being less at, but similar to something else. Is so, that we had a group of lines with identical names (and suffixes) with the exception of the middle_names, then
NULL middle_name might be a parent got ', "DEB" and "DEBORAH",.
A ' would be a parent of "DEB" and "DEBORAH", and
"DEB" would be a parent of 'DEBORAH '.
By following this chart until we find the lines that have no children, we may associate each short middle_name with the similar longer middle_name, or names. At this point, we will have "BILL RAY" as the ancestor of 'RAY MAX BILL' as well as "RAY MICHEL BILL". Here comes the following subquery, got_match_cnt. If notes how many descendants are associated with each ancesotor, in other words, how much longer names might match a name more runs. If this number is greater than 1, we do not consider one of the matches. That is why match_cnt = 1 is one of the join conditions in the main query, where each row in the theoriginale table is related to its more relative, when it exists, and if it is unique.
Tags: Database
Similar Questions
-
put an item into the basket, made an empty recycle bin, need return the item, please help, I did nothing since the drain, so the machine is in the same condition as when I emptied
If you have xp, you can do system restore
-
I need urgent assistance please. I'm recharging my Creative Suite 6 to new PC. I have the serial number, but it says it is incorrect. Please, please help as I am in the middle of a project. Why, why? It is said that the serial number is not valid - I have tried several times.
Invalid License http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html
-http://helpx.adobe.com/creative-suite/kb/invalid-serial-number-cs4.html
- and http://forums.adobe.com/thread/1038761
An idea that MAY work to install or run some programs in Windows 10 old... works for some, not for others
- or run as Administrator http://forums.adobe.com/thread/969395 to assign FULL permissions can help... said yet, but sometimes it is necessary for all Adobe programs (this is same as using an administrator account)
-
Please help I'm looking for the dowload 10.10 update my dads computer and I can not find it! Does anyone know where could it have?
10.10 is no longer available unless you had previously downloaded. In this case, it would be in the purchase of the Mac App Store section. Its not available for direct plus download.
You can directly update 10.11 El Capitan.
-
I forgot my bios password please help when 3 times hit the code 99470161.
I forgot my bios password please help when 3 times hit the code 99470161.
Thank you
Hello
Enter: 26558167
Kind regards
DP - K
-
Please help me. What is the best antivirus? capable of detecting all viruses
Please help me. What is the best antivirus? capable of detecting all viruses
I would recommend mse, and here is the important part, XP as a limited user. If you are running as an administrator, a virus can make any chages to your system, including tampering with any AV you have installed, mse, windows firewall up and running as a limited user must provide a lot of protection,
http://voices.washingtonpost.com/securityfix/2006/05/the_importance_of_the_limited.html
running as a limited user can be an inconvience initially, but once you learn how to adapt to it, your pc will be more secure and your exoierence of the user shouldn't be touched that.
-
Hi microsoft... Please help im using firefox, how the task i hidden bar when I watch YouTube... its always show when I watch any video please help
You can ask the Firefox forum.
http://forums.mozillazine.org/index.php?c=4I hope this helps.
-
I bought Adobe Master collection CS6 and accidentally damaged installation disc, but I have the serial number and need a software to download to install on my computer please help me where to download the software from?
Available downloadable Setup files:
- Suites and programs: CC 2015 | CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
- Acrobat: DC, XI, X | 9,8 | 9 standard | 8 standard
- Captivate: 8 | 7 | 6 | 5.5, 5 | 1
- Cold Fusion: 11: 10 | 9.0.2 version 9.0.0, 9.0.1, 8.0.1, 8.0.0, 7.0, 6.1, 6.0, 5.0, 4.0
- Contribute: CS5 | CS4, CS3 | 3,2
- FrameMaker: 12, 11, 10, 9, 8, 7.2
- Lightroom: 6| 5.7.1| 5 | 4 | 3
- Photoshop Elements: 14 | 13 | 12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
- Premiere Elements: 14 | 13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
Download and installation help links Adobe
Help download and installation to Prodesigntools links can be found on the most linked pages. They are essential; especially steps 1, 2 and 3. If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".
-
I can't cancel my membership of creative cloud. Phone number and links do not work. PLEASE HELP, I WON'T PAY THE NEXT BILL!
This is an open forum, not the Adobe support... You need Adobe support to cancel a subscription
-Start here https://forums.adobe.com/thread/1703848
-or by phone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
-as well as two links that can provide more details, if the links above don't help
-http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
-http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
-
Please help I can't open the pdf files of cic.gc.ca
Please help I can't open the pdf files of cic.gc.ca
Chrome does not support protected files and forms. you need to open them in Adobe reader.
Mylenium
-
Please help me to assign a new Id for different people
version 11g
Please help me in new id of person assiging for dirrerent so people it's middle name is different
I've listed on three scenarios in the example below. Please help me
Thank youWITH NAMES AS( /* Scenario1 -- Three dirrerent people so assign Three diffrrent ID, keeping 1 id as is and assign two new ids from sequence*/ SELECT 47540310 ID , 'WO' LAST_NAME , 'ROBERT' FIRST_NAME , 'C' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540310 ID , 'WO' LAST_NAME , 'ROBERT' FIRST_NAME , 'W' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540310 ID , 'WO' LAST_NAME , 'ROBERT' FIRST_NAME , 'X' MIDDLE_NAME FROM DUAL UNION ALL /* Scenario2 NULL can be equal to any value if there is only one value to equate with In the below case we have two values that can equate with null so assign three diffrent ids */ SELECT 47540300 ID , 'AMATUZIO' LAST_NAME , 'ALBERT' FIRST_NAME , 'J' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540300 ID , 'AMATUZIO' LAST_NAME , 'ALBERT' FIRST_NAME , NULL MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540300 ID , 'AMATUZIO' LAST_NAME , 'ALBERT' FIRST_NAME , 'L' MIDDLE_NAME FROM DUAL UNION ALL /* Scenario3 NULL can be equal to any value if there is only one value to equate with In the below case we have ONE VALUE that can equate with null so DONT ASSIGN ANY IDS*/ SELECT 17540300 ID , 'AMARONE' LAST_NAME , 'JOSEPH' FIRST_NAME , 'J' MIDDLE_NAME FROM DUAL UNION ALL SELECT 17540300 ID , 'AMARONE' LAST_NAME , 'JOSEPH' FIRST_NAME , NULL MIDDLE_NAME FROM DUAL ) Select * from names o/P Required ID LAST_NAME FIRST_NAME MIDDLE_NAME 47540310 WO ROBERT C 99999990 WO ROBERT W -- New Sequence Number 99999991 WO ROBERT X -- New Sequence Number 47540300 AMATUZIO ALBERT J 99999992 AMATUZIO ALBERT -- New Sequence Number 99999993 AMATUZIO ALBERT L -- New Sequence Number 17540300 AMARONE JOSEPH J 17540300 AMARONE JOSEPH
Published by: new learning June 7, 2012 14:12I do not understand what does this line:
FIRST_VALUE (fn_get_person_id) - sequence to function
I feel that the only difference with my query is to select distinct values, do not consider duplicates. Correct me if I'm wrong.
For me, this should give the same result as your query:
WITH NAMES AS ( /* Scenario1 -- Three dirrerent people so assign Three diffrrent ID, keeping 1 id as is and assign two new ids from sequence*/ SELECT 47540310 ID, 'WO' LAST_NAME, 'ROBERT' FIRST_NAME, 'C' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540310 ID, 'WO' LAST_NAME, 'ROBERT' FIRST_NAME, 'C' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540310 ID, 'WO' LAST_NAME, 'ROBERT' FIRST_NAME, 'W' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540310 ID, 'WO' LAST_NAME, 'ROBERT' FIRST_NAME, 'X' MIDDLE_NAME FROM DUAL UNION ALL /* Scenario2 NULL can be equal to any value if there is only one value to equate with In the below case we have two values that can equate with null so assign three diffrent ids */ SELECT 47540300 ID, 'AMATUZIO' LAST_NAME, 'ALBERT' FIRST_NAME, 'J' MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540300 ID, 'AMATUZIO' LAST_NAME, 'ALBERT' FIRST_NAME, NULL MIDDLE_NAME FROM DUAL UNION ALL SELECT 47540300 ID, 'AMATUZIO' LAST_NAME, 'ALBERT' FIRST_NAME, 'L' MIDDLE_NAME FROM DUAL UNION ALL /* Scenario3 NULL can be equal to any value if there is only one value to equate with In the below case we have ONE VALUE that can equate with null so DONT ASSIGN ANY IDS*/ SELECT 17540300 ID, 'AMARONE' LAST_NAME, 'JOSEPH' FIRST_NAME, 'K' MIDDLE_NAME FROM DUAL UNION ALL SELECT 17540300 ID, 'AMARONE' LAST_NAME, 'JOSEPH' FIRST_NAME, 'Y' MIDDLE_NAME FROM DUAL UNION ALL SELECT 17540300 ID, 'AMARONE' LAST_NAME, 'JOSEPH' FIRST_NAME, NULL MIDDLE_NAME FROM DUAL UNION ALL SELECT 17540300 ID, 'AMARONE' LAST_NAME, 'JOSEPH' FIRST_NAME, 'M' MIDDLE_NAME FROM DUAL UNION ALL SELECT 17540300 ID, 'AMARONE' LAST_NAME, 'JOSEPH' FIRST_NAME, 'M' MIDDLE_NAME FROM DUAL UNION ALL SELECT 99999999 ID, 'LO' LAST_NAME, 'CHRISTY' FIRST_NAME, NULL MIDDLE_NAME FROM DUAL UNION ALL SELECT 99999999 ID, 'LO' LAST_NAME, 'CHRISTY' FIRST_NAME, 'M' MIDDLE_NAME FROM DUAL UNION ALL SELECT 99999999 ID, 'LO' LAST_NAME, 'CHRISTY' FIRST_NAME, 'M' MIDDLE_NAME FROM DUAL), sel_names AS ( SELECT id , last_name , first_name , middle_name , COUNT (middle_name) OVER (PARTITION BY id ORDER BY middle_name) cnt , ROW_NUMBER () OVER (PARTITION BY id ORDER BY middle_name) rown FROM (SELECT DISTINCT * FROM names) -- use SELECT DISTINCT here to remove duplicates ORDER BY 1, 2, 3, 4 ) SELECT 8888888 new_id, id, last_name, first_name , middle_name FROM sel_names WHERE cnt > 1 AND rown > 1;
As you can see I have just replace the table with a view of inline using SELECT DISTINCT *.
FROM (SELECT DISTINCT * FROM names) -- use SELECT DISTINCT here to remove duplicates
For the new id I put a dummy value 888888, you can use a function or sequence according to your needs.
Kind regards.
Al -
Due to a series of problems with my computer old (now), I uninstalled Adobe Photoshop and Premiere Elements, after carefully printed on the profile and serial numbers. Now, after buying a Windows 10 HP desktop, I tried to install a very valuable software. From the beginning of the installation, I entered the serial number - as - my print-out. He refused and I was asked to enter again! Checked and re-checked-exactly as I had entered it. But the refusal of those same numbers have persisted.
Logging into my account - after the link printed for the serial number of the product (https://www.adobe.com/go/acctmgmtserialnum) has failed to implement a destination in my browser - I see that there is mention of maintenance — although the denial of my serial number was not this as a problem, rather simply accepting the number. Under my products, I drew the caveat that the information could not be provided.
I learned that a forum - an area in which I never dared before - is my ONLY option. Even though I remember receiving a lot of emails about CC - I was very happy with my existing Photoshop and still haven't use iCloud.
As a 'beginner' complete in this way to get an answer, please help.
Photoshop has been replaced and now to keep my software being installed as redundant? Is it simply the maintenance being undertaken - and the rejection of serial number simply a warning "generic"? -Thank you in advance - for any help you can afford me.
I was not yet looking for Adobe Premiere Elements - waiting for the same print to attract the same rejection of the number.
You MAY have just run into a case of an old program that will not properly install on a new operating system
Windows 10 is not really compatible with your version 9
An idea that MAY work to install or run some programs in Windows 10 old... works for some, not for others
-The icon of the program or EXE file RIGHT click and select a compatibility mode in the pop-up option
- or run as Administrator http://forums.adobe.com/thread/969395 to assign permissions Windows COMPLETE can help... said yet, but sometimes it is necessary for all Adobe programs (this is same as using an administrator account)
-
Please help with conditional actions showing the PlayBar
I tried to set up a tip action that will not allow users to move forward until they have clicked on the 3 themes I want to see again them. I assigned variables, follow the tutorials and do everything now. Please help how I my Advanced actions set upwards... everything shows and hides all work so I have to assume that the assignment of variable works as well. I used numbers initially and changed my value of the variable of "dude" just to make sure I was not missing something.
Here's the aciton condtional which is performed after the entry of the slide
All logic seems in tact for me however I click on each of my boxes and all conditions must be true, but will not display game bar...
Note: I also tried to show a next button and just show the things randomly with the same logic and it just will not work... What am I doing wrong?
Something escapes me in your question: How do trigger you the conditional action? I suspect that he is never executed, but may be wrong of course.
I created a small example to check: slide contains 3 buttons that trigger an action condtional with two decisions. The first decision is a simulated standard measure (condition 1 = 1 is always correct) assigns the value 1 to the variable corresponding user and displays a caption text, that was initially hidden. This is a screenshot of this first decision Stand for the first Bt_One action to be triggered by the first button:
The second decision Check is the action of condtional real, very similar to yours. This will be done after the first decision:
Create a duplicate of this action for the other two buttons, you only have to edit the first decision where the user variable needs to be changed.
In my example, when you click the last button (regardless of the sequence) all the text captions should have been disclosed (I na not hide others, but you can do the same of course) and the second decision check will result in a positive response, so the playback bar appears immediately.
Lilybiri
-
Please help, my iphone cannot reach the cellular network
Please help me, my phone can not reach the cellular network since this morning (5 h). I have already contacted the network support and they said that there is nothing wrong with the network. the State on the screen 'search'... Please help me... I can't use my phone... Help, please
You can try to reset your device. It will not destroy your data.
Press and hold the sleep/wake button
Press and hold the Home button
Press and hold both buttons until the display turns off and on again with the Apple logo on the subject.
Another way is to go to settings - general - reset - Reset all settings
-
Once per month for 6 months, I get an email saying that my Adobe CC will be cancelled. So I contact online support to fix it. After going through several stages as the change of the mode of payment by myself does not help person gets actually agree to a change in payment. Good that it is corrected. A month later same email appears. Go through the same process with online help. He swears that it is 150% fixed. A month later the same email appears. This lasts for months now. The people of the online help can't fix actually. What makes it so frustrating is that they absolutely refuse to upgrade the issue that extends beyond the online help for the India Center, even if after going through the very same thing month after month. There is something wrong beyond what may set the guys of the India online help. Does anyone know how to get in touch with real Adobe USA customer service?
Well Brent you must reach out to the support for the resolution of the issue.
* Be sure to stay connected with your Adobe ID before accessing the link above *.
Maybe you are looking for
-
Satellite U840-10R: is it possible to delete all partitions + install Win 8
Hello everyone, I bought a labtop U840-10R yesterday and I would like to know if it is possible to delete all TOSHIBA partitions and create a single partition SSD (for windows 8) and another 500 GB for files? I met some difficulties to understand how
-
problems with Xerox Phaser 3124 in window XP system
Hi, I use Xerox Phaser 3124, but recently it suddenly does not work on my Windows XP and I could not print at all. I tried reinstalling the driver, but to no avail. the system do not allow the installation of the driver. I also tried to restore to an
-
How to set a dynamic mask?
Hello!Masters.I'm here to ask for your help on the masks on the dates and values, I studied a lot of things and I have not found how do what you want, don't know if it is possible, I will try to explain what you like, put a picture to try to relieve
-
Nice dayI would like to know if those who attended Adobe Max 2015 get a free Adobe stock or any which favor her ticket? If I remember correctly, it was announced during the keynote that we have a free Adobe stock. Is this correct? If so, how can we g
-
Is drawn to the 3D rendering work with Dual GPU Ray?
Hello everyone. I anticipate a ditching my Macbook and building a PC customized for my graphic work. I had scabies and the know-how to do it for a while, and my Mac is getting pretty old.Anyway, I know that I need a NVIDIA GPU, which is certified to