i want update all null value colums
for example for emp table
id name comm email_id
101 TATA 1000 null
update emp set comm=5000 where email_id =null
is it possiable
Printable View
i want update all null value colums
for example for emp table
id name comm email_id
101 TATA 1000 null
update emp set comm=5000 where email_id =null
is it possiable
try using
[B]
update emp set comm=5000 where email_id is null[/B]
[QUOTE=priyasp_msit;27932]i want update all null value colums
for example for emp table
id name comm email_id
101 TATA 1000 null
update emp set comm=5000 where email_id =null
is it possiable[/QUOTE]
Hi Priya,
We can not use to compare a null value with '=' operator. For this we have to use the 'is' keyword.
You can use this
update emp set comm=5000 where email_id[B] is [/B]null
---V V---
Vikas Vaidya
[QUOTE=priyasp_msit;27932]i want update all null value colums
for example for emp table
id name comm email_id
101 TATA 1000 null
update emp set comm=5000 where email_id =null
is it possiable[/QUOTE]
Its not like that,
We will get it by trying this,
Update emp set comm=5000 where email_id [B]is[/B] null
[B]On comparing NULL values Use the key word [B]IS[/B][/B]
Cherrs :)
Prashanth Chenna,
Priya,
In the database one null value never equals to the another null value, so you can't use "=" for null check. You have to use "IS Null" like that...
[QUOTE=nageshkota;36368]Priya,
In the database one null value never equals to the another null value, so you can't use "=" for null check. You have to use "IS Null" like that...[/QUOTE]
Hi,
To set a NULL Value in a cell we can use the Operator "="
But on executing a Condition on NULL Value we have Use the Key word "is"
( So, according to situation we can use either = or Is )
Ex:
1. Update emp set eno=11 where salary [B]is NULL[/B]
2. Update emp eno[B]=Null[/B] wher ename is 'Prashanth'
Please post ur Comments.
Regards,
Prashanth Chenna.
Prasanth,
u r right u can assign to null value as u given in the sample query, but u can't use the "=" in the where clause, in that case you have to use only "IS".
Hi Nagesh,
I didn't get u clearly. Please give some Examples to justify ur answer.