I need to be able to build a list of address references (UPRN) and cross match with another table looking up the same UPRN .
If there IS
a match on the 2nd table then I need to set a price column to be 10.00 otherwise if there is no match (null) I want to set a price of 20.00
This code lists all the UPRN data from t_blpu and then if there is a UPRN match in t_refuse_garden_2014 also lists that in the column next to it.
Really all I want is every c_uprn from t_blpu then a set of prices next to each one depending if there is a match or not.
For info the c_uprn in t_blpu is prefixed '0000' hence the addition.
SELECT t_blpu.c_uprn, t_refuse_garden_2014.green_uprn
FROM t_blpu LEFT OUTER JOIN
t_refuse_garden_2014 ON t_blpu.c_uprn = '0000' + t_refuse_garden_2014.green_uprn
ORDER BY t_refuse_garden_2014.green_uprn DESC