-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddressUpdate.sql
More file actions
69 lines (49 loc) · 2.17 KB
/
AddressUpdate.sql
File metadata and controls
69 lines (49 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- select before and after
select * from organization where address like '% (LAUHALA) %';
-- select before
select * from rolodex
where address_line_2 like '%(LAUHALA)%';
--select after
select * from rolodex
where address_line_2 like 'Lauhala Building %';
--select after second
select * from rolodex
where address_line_2 like 'Suite %';
update organization
set address=replace(address,'677 Ala Moana Blvd, CANCER CENTER OF HAWAII (LAUHALA)','1236 Lauhala Street, CANCER CENTER OF HAWAII (LAUHALA)')
where address like '677 Ala Moana Blvd, CANCER CENTER OF HAWAII (LAUHALA) %';
update rolodex
set address_line_1 = '1236 Lauhala Street',
address_line_2 = replace(address_line_2,'CANCER CENTER OF HAWAII (LAUHALA)','Lauhala Building'),
postal_code = '96813-2417'
where address_line_2 like '%(LAUHALA)%';
update organization
set address=replace(address,'1236 Lauhala Street, CANCER CENTER OF HAWAII (LAUHALA)','1236 Lauhala Street, UH Cancer Center (LAUHALA)')
where address like '1236 Lauhala Street, CANCER CENTER OF HAWAII (LAUHALA) %';
update rolodex
set address_line_2 = replace(address_line_2,'Lauhala Building','Suite')
where address_line_2 like 'Lauhala Building %';
-- select before and after
select * from organization where address like '%MEDICAL RESEARCH BLDG%';
-- select before
select * from rolodex
where address_line_2 like '%MEDICAL RESEARCH BUILDING%';
update organization
set address=replace(address,'JABSOM MEDICAL RESEARCH BLDG','Biosciences Bldg')
where address like '%MEDICAL RESEARCH BLDG%';
update rolodex
set address_line_2 = replace(address_line_2,'JABSOM KAKAAKO MEDICAL RESEARCH BUILDING','Biosciences Bldg')
where address_line_2 like '%MEDICAL RESEARCH BUILDING%';
-- select before and after
select * from organization where address like '%Biosciences Bldg%';
-- select before
select * from rolodex
where address_line_2 like '%Biosciences Bldg%';
---- Done on 01/10/2013
select count(*) from rolodex
where address_line_1 like '%Donagho%';
select count(*) from rolodex
where address_line_1 like '%Donaghho%';
update rolodex
set address_line_1 = replace(address_line_1,'Donagho','Donaghho')
where address_line_1 like '%Donagho%';