Reputation: 7777
I have a select Query in employee table. I need to make sure that column value(empaddress)
always pass an empty value in select query:
SELECT
empname,
empaddress,
empDeptid
FROM
empiD=3
I know that empaddress can contain any value like Null or data. But in the result set it should always be blank
Upvotes: 1
Views: 288
Reputation: 43
Simply add ISNULL
function with '' and it will appear blank:
SELECT
empname,
ISNULL(empaddress,'') AS EmpAddress,
empDeptid
FROM
empiD=3
Upvotes: -1
Reputation: 2566
SELECT empname, Isnull(empaddress,'')empaddress, empDeptid FROM empiD=3
Upvotes: 0
Reputation: 924
Try something like this:
SELECT
empname,
null as empaddress,
empDeptid
FROM
empiD=3;
Upvotes: 2
Reputation: 7111
You could do something like this:
SELECT
empname,
"" as empaddress,
empDeptid
FROM
empiD=3
Unless I am missing something here that would return a blank string in place of the empaddress
Upvotes: 2