Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    121

    Unanswered: UPDATE statement

    I can't seem to recall how to update a field with a NULL value. i.e. I want to make the value in the the field "NULL". See below...

    UPDATE employee
    SET commission = NULL
    WHERE lastname = 'Jones';

    I realize the syntax above is incorrect (nothing can equal NULL). Would someone correct the query so that the value in the id field will be updated to NULL?

    Thank you

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: UPDATE statement

    Originally posted by tmalone
    I can't seem to recall how to update a field with a NULL value. i.e. I want to make the value in the the field "NULL". See below...

    UPDATE employee
    SET commission = NULL
    WHERE lastname = 'Jones';

    I realize the syntax above is incorrect (nothing can equal NULL). Would someone correct the query so that the value in the id field will be updated to NULL?

    Thank you
    No, that's correct. The "=" in the SET command means "assign the value of NULL to commission", it is not a comparison.

  3. #3
    Join Date
    Aug 2002
    Posts
    121
    Oh? ... I didn't realize I was correct the first time. I guess I'm mixed-up because I know that "=" cannot not be used in conjunction with NULL when querying. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •