0

I have one table it contains the record .The below is the sample.

 $40608$<12988>

What we need ?

I need to update the record where it presents in the table using the value "12988" and again update the value("12988") to 12989.

I have tried to search the record in postgresql using the LIKE '%<12988>%' i need to update the value ($40608$<12988>)

1
  • 2
    $40608$<12988> I don't want to see benchmarks for more complex queries with this kind of structure... Anyway, what UPDATE statement did you use? Commented Mar 31, 2011 at 12:39

1 Answer 1

3

testbed:

create table t(val text);
insert into t(val) values ('$40608$<12988>');

select * from t;
      val
----------------
 $40608$<12988>
(1 row)

update:

update t 
set val=replace(val, '<12988>', '<12989>')
where val like '%<12988>';

result:

select * from t;
      val
----------------
 $40608$<12989>
(1 row)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.