Reputation: 33
I am learning SQL and using Myworkbench to do so. The error is pointing to the isempty function. Where am I going wrong?
SELECT a.ParcelID, a.PropertyAddress, b.ParcelID, b.PropertyAddress,
isempty(a.propertyAddress,b.propertyAddress)
FROM portfolioproject.nashvillehousing a
join nashvillehousing b
on a.ParcelID = b.ParcelID
and a.UniqueID <> b.UniqueID
where a.PropertyAddress = '';
Upvotes: 2
Views: 264
Reputation: 49375
You should use COALESCE
SELECT a.ParcelID, a.PropertyAddress, b.ParcelID, b.PropertyAddress,
COALESCE(a.propertyAddress,b.propertyAddress)
FROM portfolioproject.nashvillehousing a
join nashvillehousing b
on a.ParcelID = b.ParcelID
and a.UniqueID <> b.UniqueID
where a.PropertyAddress = '';
Upvotes: 1