Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Posts
    3

    Unanswered: Multiple rows updated with multiple values

    Hi All ,

    This is my first thread .Need your suggestion on my below query.
    I have to update few sequence numbers with the sequence number + offset value
    The catch is the number of rows that will be updates will be done by select query

    Example Select row_id from table where con = 'a'
    o/p
    row_id
    11111
    22222
    33333
    44444


    Now these 4 values will be updated with original value + offset and the select query can return any number of rows

    how to implement this .
    Thanks for your kind co-operation

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    UPDATE TABLEA SET ROW_ID = ROW_ID+1000 WHERE CON = 'a';
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Thanks for the reply but my requirement is little different the ROW_ID value is from some table from some other DB .
    I am finding the range of list of gaps from target table and updating my source table with those empty values

    For target table I am finding the empty values like
    select row_id, next_row_id from (select row_id, lead(row_id) over (order by row_id) next_row_id from FT_PRODUCT)where row_id <> next_row_id-1 and row_id >0

    Now my question is how to update the values for few rows in source area with these empty values in target area

    Example I get a rabge 4-8 row id is empty in target and I want to update my row id from 50-54 with the value from 4-8

Posting Permissions

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