Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Posts
    36

    Unanswered: changing </p> to nothing did not work...

    I tried to run this query, but it did not change the </p> to a null value (in other words delete the </p>)
    Code:
    UPDATE xcart_products 
       SET descr = REPLACE(descr,'</p>','')
    What's wrong with the query, please?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    becuase NULL isn't the same as ''

    try
    Code:
    UPDATE xcart_products 
       SET descr = descr = '</p>' where descr = '' or descr is NULL;
    however you may want to test the SQL does the right thing before committing such a change to actual data
    so either run the update against a copy of your table or

    Code:
    select descr from xcart_products 
       where descr = '' or descr is NULL;
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2008
    Posts
    36
    The descr field values contain values that include </p>. I only want to delete </p> within the field values. So in other words:
    record 1 = "aldsfj akldsjflas alksdjf </p> aldsjf aeldfjk"
    I want to change record 1 to = "aldsfj akldsjflas alksdjf aldsjf aeldfjk"

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Leafgreen View Post
    What's wrong with the query, please?
    nothing

    there must be some other reason
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •