I have two tables of town names , in one table the spellings are correct(table x) whilst on the other there are some mistakes (table y).
I would like to run a query that will read table y and tell me all entries on it which do not have a match on table x - the towns must also be in the same county, detailes below
CREATE TABLE X
(
ID NUMBER,
NAME VARCHAR2(100 BYTE),
COUNTY_ID VARCHAR2(100 BYTE),
RATING_AREA VARCHAR2(100 BYTE),
RATING_AREA_CODE VARCHAR2(100 BYTE),
CODE_ID INTEGER
)
CREATE TABLE Y
(
ID NUMBER(10),
DESCRIPTION VARCHAR2(40 BYTE),
COUNTY_ID NUMBER(10),
ISN VARCHAR2(7 BYTE),
RATING_CODE NUMBER(10),
HOME_RATING_CODE NUMBER(10)
)
CREATE TABLE COUNTY
(
ID NUMBER(10),
DESCRIPTION VARCHAR2(40 BYTE),
RATING_CODE NUMBER(10),
HOME_RATING_CODE NUMBER(10)
)
the name field in table x should correspond with the description field in table Y, but Y are in upper case whilst X is in sentence case - the county_id on table X (which is the county name) should match the name held on a county file with an ID matching the County_ID on the Y file , the county file names are in upper case as opposed to the county name on X being in sentence
can anyone tell me what the best way to get the desired result would be
Thanks
LT