I don't know how to do this, Please anyone help me on this?
Asked
Active
Viewed 48 times
-5
-
Try using `COALESCE()` ? ... – Tim Biegeleisen Jan 09 '17 at 23:10
3 Answers
1
You can do this on a select to modify null field to return something else
select COALESCE(t.[MyField],'This Field is NULL') from MyTable t
Link to functions for various rdbms : http://www.w3schools.com/sql/sql_isnull.asp
MS SQL Server for instance has ISNULL

aggaton
- 3,066
- 2
- 25
- 36
1
If it is about changing the value in the database, try...
update mytable set myNullableAttribute = 'a specific value' where myNullableAttribute is null

Stephan Lechner
- 34,891
- 4
- 35
- 58
0
Hi @Kindnesscounts123YT ,
Please have a look below example for your question.
In employee table ,before using ISNULL function it will show below Output
Query :
select * from emp
Output :
empno empname salary gender
1 Pradeep 1500 Male
2 Ajay 2500 NULL
When I use ISNULL function , i will get below output
Query :
select
empno,
empname,
salary,
ISNULL(gender,'hi') as Gender
from
emp
Output:
empno empname salary Gender
1 Pradeep 1500 Male
2 Ajay 2500 hi

Pradeep Sb
- 28
- 4