Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    18

    Unanswered: help me on how to update values with some condition ?

    hi..

    I have data as below:-
    Code:
    select qualifier from nv2_audit_log where qualifier like '%NXPRI%NXUPM%';
    
    /acec/nv2am/data/input/NXPRI/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXPRI/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXPRI/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXPRI/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXPRI/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXPRI/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXPRI/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXPRI/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXPRI/NXUPM.P691811_691910
    The question is how could i update all the qualifier from
    /acec/nv2am/data/input/NXPRI/NXUPM.P691811_691910 to /acec/nv2am/data/input/NXUPM/NXUPM.P691811_691910 where qualifier like '%NXPRI%NXUPM%' ?.. Could somebody help me ?

    Actually i want to change the NXPRI to be NXUPM only for all record with qualifier like '%NXPRI%NXUPM%'

    The output must be like this:-
    Code:
    /acec/nv2am/data/input/NXUPM/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXUPM/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXUPM/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXUPM/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXUPM/NXUPM.P691011_691110
    /acec/nv2am/data/input/NXUPM/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXUPM/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXUPM/NXUPM.P691811_691910
    /acec/nv2am/data/input/NXUPM/NXUPM.P691811_691910
    Thank you,
    baharin

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Check the REPLACE function (it will do the update).

    WHERE clause remains the same as the one you used in SELECT statement.

Posting Permissions

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