Concatenate strings

From SQLZOO
Revision as of 14:16, 17 July 2012 by Connor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Concatenate strings.

schema:gisq

Concatenation means "stick strings together". In this example we concatenate three strings, name and region are string attributes of the table, ' is in ' is a string literal.

 
 
SELECT name & ' is in ' & region
  FROM bbc
  WHERE name LIKE 'D%'
SELECT name + ' is in ' + region
 FROM bbc
 WHERE name LIKE 'D%'
SELECT CONCAT(name, ' is in ', region)
  FROM bbc
  WHERE name LIKE 'D%'
SELECT name || ' is in ' || region
 FROM bbc
 WHERE name LIKE 'D%'


Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense