Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    124

    Unanswered: Select/Update selection problem

    My challenge is to insert the email address in the username_usr field if username field is empty.

    The first query returns no rows

    SELECT username_usr, EMail
    FROM CBA
    WHERE username_usr IS NULL

    This one does return rows

    SELECT username_usr, EMail
    FROM CBA
    WHERE EMAIL IS NOT NULL

    This affects no rows yet there are a number of cases where there is an EMAil and username_usr id empty. FIeld types are identical!

    UPDATE CBA SET username_usr = EMail
    WHERE username_usr IS NULL


    Nick

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    NULL and empty are not the same thing check for username_user=''

  3. #3
    Join Date
    Jan 2009
    Posts
    124
    Thanks, i'd forgotten

    Nick

Posting Permissions

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