469,326 Members | 1,216 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

how to add one more column using IS NULL

seshu
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
regards
seshu
Jan 17 '07 #1
2 1457
ronverdonk
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
ronverdonk
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.