DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Today's quick code quiz.....

  1. #1
    Join Date
    Dec 1999
    Location
    Purgatory
    Posts
    346

    Today's quick code quiz.....

    Hi Guys,

    Here's the problem -

    Compare 2 columns in a table, if either are set to 'Y', then update a third column with 'Y'

    Can this be done in one SQL statement?

    Much obliged for your input.

  2. #2
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    update tab set col_3 = 'Y' where col_1 = 'Y' or col_2 = 'Y' ..

    is this wat you are looking for?

    or i completely got ur Q wrong

    or was that a joke?
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  3. #3
    Join Date
    Dec 1999
    Location
    Purgatory
    Posts
    346
    I can't be that simple can it? Hmmm......

    Maybe I forgot my brain this morning.......

Posting Permissions

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


Click Here to Expand Forum to Full Width