Hi All,

First of all, thanks for taking time!

The problem i've got is the following:

I am trying to do an update to a range of data in a field:
I've got some products stored in database like this

l-aa223221
l-aa2243232fe32
l-aa224322ddew23

I would like to transforms these multiple rows like this:

l-aa223 should be updated or replaced like this l-223 so the aa part should be replaced. How can i achieve this?

Thanks,

ww.

P.S. It is not possible to use asterisk's for matching purpose in query, i guess.. like this;

UPDATE tabel1 SET field1='l-*' WHERE field1 = LIKE 'l-aa' something.

Recommended Answers

All 3 Replies

UPDATE tabel1 SET field1=REPLACE(field1,'-aa','-')

hi wowawiwa

do this this is helful for u

Update Table1 set field1 = REPLACE(field1, 'aa', '');

Regards

Saurav

HI,
I USE -aa IN REPLACE METHOD FOR MORE SPECIFIC CAUSE aa CAN APPEAR MORE RATHER THAN -aa

SO KEEP IN MIND THAT MY ABOVE POST WILL REPLACE ALL -aa OCCURENCE.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.