How to display a note if a row does not exist? SQL Server -
i want display phone numbers of customer(customertable).
but if there no phone number because customer hasn't left one, want display note saying "no phone number".
i've tried command
select phonenumber customers if phonenumber null raiseerror 'no phonenumber' -error but error:
"phonenumber" not valid columnname
and guess raiseerror not proper way display note (?!)
please help
sorry poor english.
why not use coalesce return first non-null value?
select coalesce(phonenumber, 'no phone number') customers
Comments
Post a Comment