locked
how to do it with one query. RRS feed

  • Question

  • User-240513752 posted
    Update T_WEBLInk 
    SET BOOKING_LINK  = 'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7885#BookNow' 
    WHERE WEBLINK_ID =1
    
    Update T_WEBLInk 
    SET BOOKING_LINK  =  'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7828#BookNow'
    WHERE WEBLINK_ID =2
    
    Update T_WEBLInk 
    SET BOOKING_LINK  =  'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7884#BookNow'
    WHERE WEBLINK_ID =3

    Thursday, October 26, 2017 6:22 AM

Answers

  • User-1768369891 posted

    Try this 

    Update T_WEBLInk 
    SET BOOKING_LINK  = CASE WEBLINK_ID 
    WHEN(1) THEN 'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7885#BookNow' 
    WHEN(2) THEN 'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7828#BookNow' 
    WHEN(3) THEN 'https://booking.falcksafety.com/en-GB_NL/Details?courseCode=7884#BookNow'
    ELSE BOOKING_LINK   END WHERE WEBLINK_ID in (1,2,3)

    Reference link :- https://stackoverflow.com/a/20255203/8411294

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 26, 2017 6:46 AM