Viewing 9 posts - 1 through 9 (of 9 total)
solved for mysql with:
UPDATE mytable SET field=CONCAT('<h2>' , REPLACE(field,'<h2></h2>','</h2>'))
WHERE field LIKE '%<h2></h2>'
................
for sql this might work:
UPDATE mytable SET field=('<h2>' + REPLACE(field,'<h2></h2>','</h2>'))
WHERE field LIKE '%<h2></h2>'
Thanks for the help, guys!
May 25, 2011 at 4:52 am
Thanks....
DECLARE @x VARCHAR(50)
SET @x='Maryland<h2></h2>'
SELECT * , '<h2>'+ REPLACE(@x,'<h2></h2>','</h2>')
FROM 'node_revisions'
WHERE @x LIKE '%<h2></h2>'
gives me syntax error still...
May 24, 2011 at 2:39 pm
yes - is the syntax different? I was under the impression it is the same...
May 24, 2011 at 2:29 pm
I copied/pasted Lutz's query, adding * FROM 'table' to the SELECT...
DECLARE @x VARCHAR(50)
SET @x='Maryland<h2></h2>'
SELECT * FROM 'table' '<h2>'+ REPLACE(@x,'<h2></h2>','</h2>')
WHERE @x LIKE '%<h2></h2>'
#1064 - You have an error in your SQL...
May 24, 2011 at 2:22 pm
Thanks for trying guys - and sorry for the delay replying. I appreciate your time and efforts.
I got sidetracked putting out some other fires today - and just to save...
May 24, 2011 at 2:14 pm
I see that - but getting syntax errors
I appreciate the help, you guys...
May 24, 2011 at 1:27 pm
Yes, I'm trying it using wildcards - % - with no success so far
May 24, 2011 at 1:22 pm
Thanks, Lutz
I can do the same thing with
UPDATE table set teaser=replace(teaser, '<h2></h2>', '</h2>')
to change
Maryland<h2></h2>
Maine<h2></h2>
etc....
to
Maryland</h2>
Maine</h2>
etc...
The second step of adding an opening <h2> tag to the beginning of the...
May 24, 2011 at 1:13 pm
There are nine fields in the table.
That particular field - "teaser" -does contain other strings in most rows, but in those 50 rows the data is exactly as:
Maryland<h2></h2>
Maine<h2></h2>
Louisiana<h2></h2>
Kentucky<h2></h2>
Kansas<h2></h2>
Iowa<h2></h2>
...and so on......
May 24, 2011 at 1:08 pm
Viewing 9 posts - 1 through 9 (of 9 total)