Results 1 to 3 of 3

Thread: update query

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Unanswered: update query

    CUSTOMER_ID CUSTOMER_NAME CITY
    ----------- -------------------------------------------------- -------------------
    7001 Microsoft San Francisco
    7002 IBM Toronto
    7003 Red Hat Newark

    update CUSTOMERS set
    customer_name =(SELECT DECODE(CUSTOMER_NAME,'IBM','Sam')
    from customers
    where CUSTOMER_id=7002)
    where CUSTOMER_name=
    (select decode(CUSTOMER_name,'Microsoft','san')
    from customers
    where customer_id=7001)

    this query returns zero updated so please tell why?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Could it be because you don't have a customer named 'san' in your table?
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    What are you actually trying to do?
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Tags for this Thread

Posting Permissions

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