Difference between revisions of "CONCAT"

From SQLZOO
Jump to: navigation, search
Line 34: Line 34:
 
<p>See also</p>
 
<p>See also</p>
 
<ul>
 
<ul>
   <li>[[SUBSTRING function]]</li>
+
   <li>[[SUBSTRING |SUBSTRING function]]</li>
 
   <li>[[TRIM |TRIM function]]</li>
 
   <li>[[TRIM |TRIM function]]</li>
 
</ul>
 
</ul>

Revision as of 15:40, 16 July 2012

Compatibility
CONCAT(s1, s2)
EngineOKAlternative
ingresYes
mysqlYes
oracleNos1 || s2
postgresNos1 || s2
sqlserverNos1 + s2

CONCAT

CONCAT allows you to stick two or more strings together.

This operation is concatenation.

   CONCAT(s1, s2 ...)   

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

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

See also

Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense