User Profile

Collapse

Profile Sidebar

Collapse
agowtham2
agowtham2
Last Activity: Feb 7 '15, 11:04 AM
Joined: Feb 3 '15
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Code:
    update Xipu.tqx0sn_Change_audit_day as t
        set t.Update_time = X.Update_time 
        X X X  
        select * from (select  Max(A.Update_time) as Update_time , A.Task_number , A.Update  from Xipu.tqx0sn_Change_audit_day A 
        join Xipu.tqx0sn_Change_audit_day B 
        On A.Task_number = B.Task_number  
        And A.Update = B.Update
        And A.Update_time <> B.Update_time
        group by A.Update , A.Task_number
    ...
    See more | Go to post
    Last edited by Rabbit; Feb 6 '15, 06:26 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data. Second Warning

    Leave a comment:


  • I a working in DB2 and i tried ur example and tried and it was not working. can u please edit the query i sent and post it
    See more | Go to post

    Leave a comment:


  • Code:
    update Xipu.tqx0sn_Change_audit_day as t
    set t.Update_time = X.Update_time 
    X X X  
    select * from (select  Max(A.Update_time) as Update_time , A.Task_number , A.Update  from Xipu.tqx0sn_Change_audit_day A 
    join Xipu.tqx0sn_Change_audit_day B 
    On A.Task_number = B.Task_number  
    And A.Update = B.Update
    And A.Update_time <> B.Update_time
    group by A.Update , A.Task_number ) X
    on t.task_number
    ...
    See more | Go to post
    Last edited by Rabbit; Feb 5 '15, 04:28 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Leave a comment:


  • Hi ,

    I have retrived the maximum value for each combination of update_count and No.

    I don't know how to write an update statement that updates the proper value based on the key combination of Update_count and no.
    See more | Go to post

    Leave a comment:


  • Hi ,

    There are lot of numbers in the table , i need to place the max update_time if the update count is same .

    For a particular update time and No the update time should be same , if its different then i need to replace it with the Max(update_time ) for that update count.

    I hope u got my question
    See more | Go to post

    Leave a comment:


  • agowtham2
    started a topic Update Query needed to update the existing column
    in DB2

    Update Query needed to update the existing column

    I need to replace one value of a column to another.

    Example :

    No Update_count Update_time
    1 0 2015-02-02 12:23:24
    1 0 2015-02-02 12:23:24
    1 0 2015-02-02 12:24:25

    For a particular No and update count the time should be same , in this case i need to set Max(update_time ) as the time for all 3 records , Can someone help please.
    ...
    See more | Go to post
No activity results to display
Show More
Working...