I have results displaying duplicates that I don't want. We have a column call addresstypes and it returns a B or L depending on what was entered in db. It was incorrect to enter data if B was chosen as this was both delivery and legal address.
When pulling data, I get serial numbers etc but I get some twice...the ones that have address data in both B & L.
Here is my query - how can I make the double row not display?
USE inventory
SELECT distinct
dbo.addressinfo.locationinfoid, dbo.equipmentlocationscurrent.serialnum, dbo.addressinfo.addresstype
FROM dbo.equipmentlocationscurrent
full join dbo.addressinfo
on dbo.equipmentlocationscurrent.locationinfoid = dbo.addressinfo.locationinfoid
where (clientName = 'cps lease')
and (locationtype = 'merchant')
and (addresstype = 'b' or addresstype = 'l')
order by serialnum
Sample of results
locationinfoid serialnum
2887540 301-252-800 B
2887540 301-252-800 L