Forum Moderators: open

Message Too Old, No Replies

Batch update with matching in SQL

         

Etruscan

12:34 am on Jan 23, 2008 (gmt 0)

10+ Year Member



My language is going to be off, but here's what I've got. I've got a field I need to update the content for.

Field1 in the table includes data that looks like this:

ITEM1
ITEM1
ITEM2
ITEM2
ITEM2
ITEM2
ITEM3
ITEM3
ITEM4
...

I need to remove the "ITEM" portion and leave the numeric ending with an SQL query.

phranque

3:28 am on Jan 23, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



UPDATE tablename SET Field1=TRIM(LEADING 'TRIM' FROM Field1);

Etruscan

2:59 pm on Jan 23, 2008 (gmt 0)

10+ Year Member



Awesome. Thanks so much. I completely missed the TRIM syntax.