Unsupported Screen Size: The viewport size is too small for the theme to render properly.

delete n ammend data

forums forums SQLyog Using SQLyog delete n ammend data

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #8958
      anone
      Member

      im very new to this sglyog. I've created a table which have about 3k data. i hav mistakenly entered the wrong data ( eg: 12345-8), so i want to delete or ignore the '-' for my entire table, how do i do that?

    • #17681
      Shadow
      Member

      UPDATE my_table SET my_field=INSERT(my_field, (INSTR(my_field, '-'), 1,'');

      INSERT function will replace '-' character with '' (empty string) at its first occurance(INSTR locates the first occurance) in my_field.

    • #17682
      Shadow
      Member

      If you want to replace more than one occurances of '-' character, then use REPLACE() function insted of INSERT().

Viewing 2 reply threads
  • You must be logged in to reply to this topic.