REPLACE

From SQLZOO
Revision as of 11:50, 13 July 2012 by Connor (Talk | contribs) (Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>MIN(f)</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</td>...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Compatibility
MIN(f)
EngineOKAlternative
ingresYes
mysqlYes
oracleYes
postgresYes
sqlserverYes

REPLACE

REPLACE(f, s1, s2) returns the string f with all occurances of s1 replaced with s2.

 REPLACE('vessel','e','a') -> 'vassal'

In this example you remove all the 'a's from the name of each country. This happens because the string 'a' is replaced with .

SELECT name,
       REPLACE(name, 'a','')
  FROM bbc

See also