Difference between revisions of "Strings"
From SQLZOO
(Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>s1 || s2</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</t...") |
|||
| 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 14:33, 16 July 2012
| s1 || s2 | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | Yes | |
| mysql | No | CONCAT(s1,s2) |
| oracle | Yes | |
| postgres | Yes | |
| sqlserver | No | s1 + 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