According the offical explaination, CONCAT is to returns the string that results from concatenating the arguments.This is a simple example from Microsoft to
understand how to use CONCAT and what do it returns:
SELECT CONCAT ( 'Happy ', 'Birthday ', 11, '/', '25' ) AS Result;
As you seen on the image above, CONCAT is to concatenate the strings into a single string.
* **
And now let try an SQL with CONCAT to add
some string after the returned result, you can click here to make the sample table
to try this example SQL:
Result :SELECT id, post_title, CONCAT( post_title, '- ','new ','text') AS new_post_titleFROM wp_posts
Remarks
1) It requires a minimum of two input values
2) Beware that CONCAT() would returns NULL if any argument is NULL:SELECT CONCAT('My', 'S', 'QL');
SELECT CONCAT( 'My', null, 'QL' )
Reference:
No comments :
Post a Comment