I've got the next query
Select LAST_NAME from test.[USER]
Where ID = (Select test_support from test.UPGRADE
Where KEYED_NAME Like '%abc%'
and STATE = 'Active')
The result like:
LastName1
But if the Keyed_Name doesn't exist, the result is empty. I get the empty column:
How to change it to receive some other value like '-' instead empty.
So if the query result is empty, I will receive:
I tried next query
DECLARE @EmptyString NVARCHAR( 10 ) = '';
Select CASE WHEN LAST_NAME <> @EmptyString THEN LAST_NAME ELSE '-' END
from test.[USER]
Where ID = (Select test_support from test.UPGRADE
Where KEYED_NAME Like '%abc%'
and STATE = 'Active')
but it works only for case when the string is not empty.

