Dear all,

I am working with 2 tables at the moment, the first is called GAZUPRNCOORDS and the second CCADDRESS

I am attempting to right join a column from a second table following selection from the first table.

The following query runs fine and returns results on the first table GAZUPRNCOORDS:

SELECT DISTINCT UPRN, X_COORDINATE, Y_COORDINATE FROM GAZUPRNCOORDS where X_COORDINATE > 400 and X_COORDINATE < 400 and Y_COORDINATE > 200 and Y_COORDINATE < 200

What I want to do is join a column from CCADDRESS called addr3 based on matching UPRN numbers. The column containing UPRN numbers in CCADDRESS table however is named REALUPRN.

What I have so far is as below but Iām not having much luck amending it to work with a right join, can anyone advise where I am going wrong here?:

SELECT DISTINCT UPRN, X_COORDINATE, Y_COORDINATE FROM GAZUPRNCOORDS where X_COORDINATE > 400 and X_COORDINATE < 400 and Y_COORDINATE > 200 and Y_COORDINATE < 200 FROM GAZUPRNCOORDS RIGHT JOIN CCAddress ON GAZUPRNCOORDS.UPRN = CCAddress.addr3