Français English Español Italiano Português
User Login    
 + User Registration
Connexion

Concatenation


Author : lotsofcode | Lots of Code
Date : 2008-02-27T14:32:09+01:00
Views : 3

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;



URL : http://community.xoofoo.org/modules/actus_webmaster/view.article.php/8
Trackback : http://community.xoofoo.org/modules/actus_webmaster/trackback.php/8

The comments are owned by the poster. We aren't responsible for their content.
Poster Thread