Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Talking Unanswered: combining fields (sort of)

    Hi,
    Hope this is neither too obvious or laughably impossible, else I'll
    just have to be embarrased.
    Is there any way to do this:

    SELECT field1 if it is not NULL, else SELECT field2..??

    The way this dbase is set up, I'm just about suicidal.
    THANKS for any help!

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

    Re: combining fields (sort of)

    Use the COALESCE function (or NVL if using Oracle):

    COALESCE(field1,field2)

  3. #3
    Join Date
    Jan 2004
    Posts
    6

    Re: combining fields (sort of)

    Originally posted by andrewst
    Use the COALESCE function (or NVL if using Oracle):

    COALESCE(field1,field2)

    NVL did it! THANKS SO MUCH! I'd looked at that earlier but
    the sql book I have only shows literals as being valid 'convert-to'
    values. Shoulda just tried it. Thanks again!!!!!

Posting Permissions

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