Hello,
I have 2 tables:
District:
DistrictID DistrictName
1 Cairo
23 Cairo
44 Cairo
60 Alex
62 Alex
70 Aswan
74 Aswan
78 Aswan
Map:
MapID DistrictID MapName
1 1 ABC
2 44 XYZ
3 23 DEF
4 60 GHI
5 62 JKL
6 70 MNO
7 74 PQR
8 78 STU
As described above you will note that the MapID (1,2,3) has different ditrictID (and 4,5 and 6,7,8 have the same problem) though they are the same city, I need to do the following:
1- Update the "Maps" table to eliminate the duplicate districtid based on the duplication of the district table (I mean to make all the same district refer to a single DistrictID) -- the maps table have to be as follows:
MapID DistrictID MapName
1 1 ABC
2 1 XYZ
3 1 DEF
4 60 GHI
5 60 JKL
6 70 MNO
7 70 PQR
8 70 STU
2- Delete all the duplicates of the District table, districts table have to be as follows:
DistrictID DistrictName
1 Cairo
60 Alex
70 Aswan
Any ideas.
Thanks ...
Open in new window