Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)

  • RE: What should be a simple query needed

    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!

  • RE: What should be a simple query needed

    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...

  • RE: What should be a simple query needed

    yes - is the syntax different? I was under the impression it is the same...

  • RE: What should be a simple query needed

    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...

  • RE: What should be a simple query needed

    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...

  • RE: What should be a simple query needed

    I see that - but getting syntax errors

    I appreciate the help, you guys...

  • RE: What should be a simple query needed

    Yes, I'm trying it using wildcards - % - with no success so far

  • RE: What should be a simple query needed

    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...

  • RE: What should be a simple query needed

    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......

Viewing 9 posts - 1 through 9 (of 9 total)