472,142 Members | 1,189 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

how to add one more column using IS NULL

156 100+
Hi everybody
This is seshu i have a piece of code to insert data into a column by taking the data from another table and the query is like this

insert into table1 (table1.name) select table2.name from empdetails

now aditonal to this i want update table 2 whase tdate value is null
ie i wnat to update a column whose value is null

i wrote this code
update table2 set tdate='2007-01-17' where tdate='null'
for this the result is 0 rows affected
help me out please
Jan 17 '07 #1
2 1499
4,258 Expert 4TB
Null is not a value but merely the non-existence of a vaule. So when you specify WHEN value ='null' it will test for the character string 'null'. You get no meaningful results from these comparisons

In MySQL you use the IS NULL and IS NOT NULL operators.

Ronald :cool:
Jan 17 '07 #2
4,258 Expert 4TB
I have opened a new thread for the last question at thread How to use LAST_INSERT_ID()

moderator :cool:
Jan 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by me | last post: by
2 posts views Thread by James Knowlton | last post: by
2 posts views Thread by RamaKrishna Narla | last post: by
6 posts views Thread by axelsino | last post: by
2 posts views Thread by Jeff Kish | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.