Web Analytics Made Easy -
StatCounter SQL statement needed - CodingForum

Announcement

Collapse
No announcement yet.

SQL statement needed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL statement needed

    How would I change in a table every reference to "ren" to "stimpy"?

    If a value equaled "renTop" I want it changed to read "stimpyTop". All help is appreciated, thanks.
    I would rather be a lion for a day than a lamb that lives forever.

  • #2
    me soo lazy

    UPDATE TABLE_NAME SET COLUMN_NAME = replace(COLUMN_NAME,"ren","stimpy");

    this works for mysql I am not sure if the replace function is supported in any other database.
    I would rather be a lion for a day than a lamb that lives forever.

    Comment


    • #3
      It is; REPLACE() is standard SQL.

      Comment

      Working...
      X