Difference between revisions of "Strings"

From SQLZOO
Jump to: navigation, search
Line 9: Line 9:
 
<tr><td align='left'>sqlserver</td><td>No</td><td>s1 + s2</td></tr>
 
<tr><td align='left'>sqlserver</td><td>No</td><td>s1 + s2</td></tr>
 
</table>
 
</table>
 +
 
<h1>|| (strings)</h1>
 
<h1>|| (strings)</h1>
 
<p>|| allows you to stick two or more strings together. </p>
 
<p>|| allows you to stick two or more strings together. </p>
Line 37: Line 38:
 
   <li>[[TRIM |TRIM function]]</li>
 
   <li>[[TRIM |TRIM function]]</li>
 
</ul>
 
</ul>
 +
 +
{{Languages}}

Revision as of 18:05, 21 October 2012

Compatibility
s1 || s2
EngineOKAlternative
ingresYes
mysqlNoCONCAT(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: English  • Deutsch
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense