select * from MCDUFFIE_GSI.dbo.MOBIL g 
inner join 
(
SELECT MOBILEKEY, TAXDIST, MFG, MODEL, WIDTH, LENGTH, YEARBUILT, LEFT(REPLACE(LASTNAME,',',''),24) LASTNAME, CASE WHEN OVRVALUE > 0 THEN OVRVALUE WHEN GUIDE=1 THEN GUIDEVALUE ELSE VALUE END + ADDONVAL AS FMV 
FROM [WINGAP].AY2022.DBO.MOBILE M
INNER JOIN [WINGAP].AY2022.DBO.OWNER O ON O.OWNKEY=M.OWNKEY 
UNION
SELECT MOBILEKEY, TAXDISTRIC, MFG, MODEL, WIDTH, LENGTH, YEARBUILT, LEFT(REPLACE(LASTNAME,',',''),24) LASTNAME, CASE WHEN OVRVALUE > 0 THEN OVRVALUE WHEN GUIDE=1 THEN GUIDEVALUE ELSE VALUE END + ADDONVAL AS FMV 
FROM [WINGAP].AY2022.DBO.MOBILE M
INNER JOIN [WINGAP].AY2022.DBO.REPROP RP ON RP.REPROPKEY=M.REPROPKEY
INNER JOIN [WINGAP].AY2022.DBO.REALPROP R ON R.REALKEY=RP.REALKEY
INNER JOIN [WINGAP].AY2022.DBO.OWNER O ON O.OWNKEY=R.OWNKEY 

) wg on left(wg.mfg,25)=g.mfg and left(wg.model,25)=g.model and wg.yearbuilt = g.YR_BUILT and wg.taxdist=g.TAXDISTRIC and g.fmv=wg.fmv and wg.width=g.width and wg.length=g.length
	and g.OWNER_NAME=left(wg.lastname ,35)
where TAX_YEAR=2021 -- 2828 rows
	and wg.mobilekey is null 

--select * from [wingap].AY2022.dbo.M_mobile where mfg='schult' and model='enterprise'
