preload
SQL Case Statement Select Insert Statement
Feb 27

Concatenating in SQL is pretty simple, it's purpose is to connect fields and string together as one string, like so.

If you have a database table field called forename and you would like to have the word MR before each name, this is how it would be done.

SELECT CONCAT('Mr. ', forename) FROM table;

You can also pass as many arguments as you like through this function, for example.

SELECT CONCAT('Mr. ', forename, ' ', surname, ' - ', jobTitle) FROM table;

One Response to “Concatenation”

  1. ????? Says:

    thanks

Leave a Reply

 
 
Please enter the word above into the box below, the word is not case sensitive.
 
If you have trouble reading the word above then click here to load a new word.
Security word: