William Luis

0 %
William Luis
Fullstack Developer
  • Residence:
    Canada
  • City:
    Toronto
  • Age:
    26
French
English
Spanish
html
CSS
Js
PHP
WordPress
  • Bootstrap, Materialize
  • Stylus, Sass, Less
  • Gulp, Webpack, Grunt
  • GIT knowledge

Replace no MySQL

21 de maio de 2012

Código para substituir palavras ou frases dentro de uma tabela.

Sintaxe:
update table set campo = replace(campo, ‘string1’, ‘string_replace’)

Exemplo:

[sourcecode language=”mysql”]
update <strong>banco</strong> set <strong>tabela</strong> = replace(<strong>tabela</strong>, ‘palavra original’, ‘palavra nova’);
[/sourcecode]

4

Posted in Dicas, SQLTags:
Write a comment