var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Replacing text in a column for all rows in the table
I have a column like this:
Now, I would like to replace all "1001" with nothing, and also remove the "|"-separator behind 1001 if it exists, basically removing both "1001" and "1001|", so the resulting table looks like this:
My tries, been plenty, but here are some:
But the above queries replaces field1 only if the whole field matches '1001' or '1001|'...
SET field1 = REPLACE(field1, '1001', '')
SET field1 = REPLACE(field1, '1001|', '')
Wow, my mistake, the above queries do work, just like I want them to. Thanks, solved.
Edit: MCrowley, yes I know, I just happened to write them in this order on this post... did not do a copy of the actual query.
Last edited by ManyTimes; 10-25-12 at 02:25.
The only thing I might add is to reverse the order of the two queries. The first one would leave a bunch of "|"s around in the data that the second one would not be able to clean out.
Tags for this Thread