Difference between revisions of "+ (string)"
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'''</td...") |
|||
| Line 22: | Line 22: | ||
FROM bbc | FROM bbc | ||
</source> | </source> | ||
| − | <source lang='sql' class='def e- | + | <source lang='sql' class='def e-oracle e-postgres'> |
SELECT region || name | SELECT region || name | ||
FROM bbc | FROM bbc | ||
Revision as of 14:09, 16 July 2012
| s1 + s2 | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | Yes | |
| mysql | No | CONCAT(s1,s2) |
| oracle | No | s1 || s2 |
| postgres | No | s1 || s2 |
| sqlserver | Yes | |
+ (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