how to add one more column using IS NULL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seshu
    New Member
    • Nov 2006
    • 156

    how to add one more column using IS NULL

    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
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    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:

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      I have opened a new thread for the last question at thread How to use LAST_INSERT_ID( )

      moderator :cool:

      Comment

      Working...