JNali
JNali

Reputation: 33

How to use the ISEMPTY function

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

Answers (1)

nbk
nbk

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

Related Questions