Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011
    Posts
    33

    Unanswered: replacing null values in a columns with no-null values of another column

    Hi I have the following table:

    person---code3----code4

    1-------- a56----------
    2---------c40----------
    3------------------a598
    4------------------fg35
    5---------d78----------

    where code4 extends code3 by one more character (think of code4 being a subset of code3)

    What I want to do is, if code3 is null, then use code4, and if code4 is null then use code3

    Note: each person will either have a code3 or a code4

    So I want my table to look like:


    person---code

    1---------a56
    2---------c40
    3---------a598
    4---------fg35
    5---------d78

    how do i go about doing this? Thanks.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5

Posting Permissions

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