Strings

From SQLZOO
Jump to navigation Jump to search
Compatibility
s1 || s2
EngineOKAlternative
ingresYes
mysqlNo CONCAT(s1,s2)
oracleYes
postgresYes
sqlserverNos1 + s2

|| (strings)

|| allows you to stick two or more strings together.

This operation is concatenation.

   s1 || s2    

In this example you put the region and the name together for each country.

SELECT CONCAT(region,name)
  FROM bbc
SELECT region + name
  FROM bbc
SELECT region || name
  FROM bbc

See also

Language:Project:Language policy English  • Deutsch
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects