<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CONCAT &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/concat/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Fri, 09 Mar 2018 06:46:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Puzzle: SQL Advance Query &#8211; Get the DISTINCT String data after CONCAT</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/</link>
					<comments>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 14 Mar 2018 16:16:35 +0000</pubDate>
				<category><![CDATA[SQL Puzzle]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CONCAT]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Advance Query]]></category>
		<category><![CDATA[SQL Interview]]></category>
		<category><![CDATA[SQL Problem]]></category>
		<category><![CDATA[SQL Programming]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[String Data]]></category>
		<category><![CDATA[XML PATH]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219</guid>

					<description><![CDATA[Check the below input data and expected output and get the list of distinct concat string values. Input Data: [crayon-6abb11fe0a6be611663838/] Expected Output: [crayon-6abb11fe0a6c2432773071/] Create a table with sample data: [crayon-6abb11fe0a6c3270658743/] Solution using XML PATH: [crayon-6abb11fe0a6c4541824849/] Please try the different solution for this puzzle and share it via comment...]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-get-the-distinct-string-data-after-concat%2F&#038;title=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Get%20the%20DISTINCT%20String%20data%20after%20CONCAT" data-a2a-url="https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/" data-a2a-title="SQL Puzzle: SQL Advance Query – Get the DISTINCT String data after CONCAT"></a></p><p>Check the below input data and expected output and get the list of distinct concat string values.</p>
<p><strong>Input Data:</strong></p>
<pre class="crayon-plain-tag">id          strname
----------- ------------
1           abc
2           xyz
3           abc
4           pqr
5           pqr
6           xyz
7           wre
8           abc
9           wre</pre> </p>
<p><strong>Expected Output:</strong></p>
<pre class="crayon-plain-tag">result
-----------------------
abc, pqr, wre, xyz,</pre> </p>
<p><strong>Create a table with sample data:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_strings (id int, strname varchar(50))
GO

INSERT INTO tbl_strings VALUES 
(1,'abc'),(2,'xyz'),(3,'abc')
,(4,'pqr'),(5,'pqr'),(6,'xyz')
,(7,'wre'),(8,'abc'),(9,'wre')
GO</pre> </p>
<p><strong>Solution using XML PATH:</strong></p>
<pre class="crayon-plain-tag">SELECT DISTINCT strname + ', '
FROM tbl_strings
FOR XML PATH('')</pre> </p>
<p><strong><code>Please try the different solution for this puzzle and share it via comment...</code></strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Puzzle: SQL Advance Query &#8211; Concat the String records without using STUFF function</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-concat-the-string-records-without-using-stuff-function/</link>
					<comments>https://www.dbrnd.com/2018/03/sql-puzzle-concat-the-string-records-without-using-stuff-function/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 13 Mar 2018 16:16:46 +0000</pubDate>
				<category><![CDATA[SQL Puzzle]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CONCAT]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Advance Query]]></category>
		<category><![CDATA[SQL Interview]]></category>
		<category><![CDATA[SQL Problem]]></category>
		<category><![CDATA[SQL Programming]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[stuff]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7217</guid>

					<description><![CDATA[Check the below input data and expected output and concat the string data without using STUFF function. Input Data: [crayon-6abb11fe0ad6d138282690/] Expected Output: [crayon-6abb11fe0ad6f806073232/] Create a table with sample data: [crayon-6abb11fe0ad70299667578/] Solution by creating a function: [crayon-6abb11fe0ad71941979963/] Please try the different solution for this puzzle and share it via comment...]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&amp;linkname=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fsql-puzzle-concat-the-string-records-without-using-stuff-function%2F&#038;title=SQL%20Puzzle%3A%20SQL%20Advance%20Query%20%E2%80%93%20Concat%20the%20String%20records%20without%20using%20STUFF%20function" data-a2a-url="https://www.dbrnd.com/2018/03/sql-puzzle-concat-the-string-records-without-using-stuff-function/" data-a2a-title="SQL Puzzle: SQL Advance Query – Concat the String records without using STUFF function"></a></p><p>Check the below input data and expected output and concat the string data without using STUFF function.</p>
<p><strong>Input Data:</strong></p>
<pre class="crayon-plain-tag">id          strname
----------- ------------
1           a
1           b
1           c
2           x
2           y
3           p
3           q
3           r</pre> </p>
<p><strong>Expected Output:</strong></p>
<pre class="crayon-plain-tag">id          ConcatString
----------- ---------------
1           a, b, c
2           x, y
3           p, q, r</pre> </p>
<p><strong>Create a table with sample data:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_strings (id int, strname varchar(50))
GO

INSERT INTO tbl_strings VALUES 
(1,'a'),(1,'b'),(1,'c')
,(2,'x'),(2,'y')
,(3,'p'),(3,'q'),(3,'r')
GO</pre> </p>
<p><strong>Solution by creating a function:</strong></p>
<pre class="crayon-plain-tag">CREATE FUNCTION [dbo].[GetConcatString]
(
    @id int
)
RETURNS varchar(max)
AS
BEGIN
    DECLARE @str VARCHAR(max)
    SELECT @str = COALESCE(@str + ', ', '') + strname
    FROM tbl_strings
    WHERE id = @id
    RETURN @str
END
GO

SELECT id, dbo.GetConcatString(id) as ConcatString
FROM tbl_strings
GROUP BY id
GO</pre> </p>
<p><strong><code>Please try the different solution for this puzzle and share it via comment...</code></strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/03/sql-puzzle-concat-the-string-records-without-using-stuff-function/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL 9.5: How to Concatenate and Overwrite JSON Document</title>
		<link>https://www.dbrnd.com/2016/08/postgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 13 Aug 2016 18:13:43 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CONCAT]]></category>
		<category><![CDATA[data type]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[jsonb]]></category>
		<category><![CDATA[overwrite]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3443</guid>

					<description><![CDATA[The PostgreSQL JSON data type is also one of the my favorite topic. I have written multiple article on PostgreSQL JSON data type. PostgreSQL 9.4: The JSON data type is Awesome (Part 1/3) PostgreSQL 9.5 introduced one new operator (&#124;&#124;) which used to perform Concatenate and Overwrite of JSON Document. The requirement is something like: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&amp;linkname=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator%2F&#038;title=PostgreSQL%209.5%3A%20How%20to%20Concatenate%20and%20Overwrite%20JSON%20Document" data-a2a-url="https://www.dbrnd.com/2016/08/postgresql-9-5-how-to-concatenate-and-overwrite-json-document-json-jsonb-data-type-operator/" data-a2a-title="PostgreSQL 9.5: How to Concatenate and Overwrite JSON Document"></a></p><p>The PostgreSQL JSON data type is also one of the my favorite topic.<br />
I have written multiple article on PostgreSQL JSON data type. </p>
<blockquote class="wp-embedded-content" data-secret="VwMBqIgKFg"><p><a href="https://www.dbrnd.com/2016/02/postgresql-9-4-the-json-data-type-is-awesome-part-1/">PostgreSQL 9.4: The JSON data type is Awesome (Part 1/3)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/02/postgresql-9-4-the-json-data-type-is-awesome-part-1/embed/#?secret=VwMBqIgKFg" data-secret="VwMBqIgKFg" width="600" height="338" title="&#8220;PostgreSQL 9.4: The JSON data type is Awesome (Part 1/3)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>PostgreSQL 9.5 introduced one new operator (||) which used to perform Concatenate and Overwrite of JSON Document.</strong></p>
<blockquote><p>The requirement is something like: we have stored one JSON string or document into PostgreSQL. Now we require to add any new key or elements into that document. </p></blockquote>
<blockquote><p>It was not possible in the previous version of PostgreSQL, but now we can use (||) this operator to add or overwrite particular key into the JSON document. </p></blockquote>
<p><strong>Please go through this full practical demonstration:</strong></p>
<p><strong>Create a table with Sample data:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_TestJSON
(
	ID INTEGER PRIMARY KEY
	,DepartName VARCHAR(250)
	,EmployeeDetails JSONB
	,Address JSONB
);

INSERT INTO tbl_TestJSON
VALUES 
(
	1
	,'Sales'
	,'
	{"employees":[
	    {"firstName":"Anvesh", "lastName":"Patel"},
	    {"firstName":"Eric", "lastName":"Marin"},
	    {"firstName":"Martin", "lastName":"Loother"}
	]}'
	,'{"address" : "Hyderabad"}'
)
,(
	2
	,'Production'
	,'
	{"employees":[
	    {"firstName":"Neevan", "lastName":"Patel"},
	    {"firstName":"Roy", "lastName":"Boon"},
	    {"firstName":"Nancy", "lastName":"Shah"}
	]}'
	,'{"address" : "Ahmedabad"}'
);</pre> </p>
<p><strong>Using (||) operator can concat two JSON String:</strong><br />
In the below example, you can see &#8220;address&#8221; key is merged with &#8220;employees&#8221; key.</p>
<pre class="crayon-plain-tag">SELECT EmployeeDetails || Address AS JsonData FROM tbl_TestJSON;
/*
		   JsonData
------------------------------------------------
{"address": "Hyderabad"
 ,"employees": 
	[{"lastName": "Patel", "firstName": "Anvesh"}
	,{"lastName": "Marin", "firstName": "Eric"}
	,{"lastName": "Loother", "firstName": "Martin"}
	]
}
{"address": "Ahmedabad"
 ,"employees": 
	[{"lastName": "Patel", "firstName": "Neevan"}
	,{"lastName": "Boon", "firstName": "Roy"}
	,{"lastName": "Shah", "firstName": "Nancy"}
	]
}*/</pre> </p>
<p><strong>Using (||) operator can overwrite the JSON string:</strong><br />
In the below example, you can see the replacement of &#8220;address&#8221; value. </p>
<pre class="crayon-plain-tag">SELECT EmployeeDetails || Address || '{"address": "Pune"}'FROM tbl_TestJSON;
/*
		  JsonData
-------------------------------------------------
{"address": "Pune"
 ,"employees": 
	    [{"lastName": "Patel", "firstName": "Anvesh"}
	    ,{"lastName": "Marin", "firstName": "Eric"}
	    ,{"lastName": "Loother", "firstName": "Martin"}
	    ]
}
{"address": "Pune"
 ,"employees": 
	   [{"lastName": "Patel", "firstName": "Neevan"}
	   ,{"lastName": "Boon", "firstName": "Roy"}
	   ,{"lastName": "Shah", "firstName": "Nancy"}
	   ]
}*/</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server 2012: The Amazing CONCAT function for string concatenation</title>
		<link>https://www.dbrnd.com/2016/03/sql-server-2012-the-amazing-concat-function-for-string-concatenation/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 05 Mar 2016 19:04:51 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CONCAT]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1900</guid>

					<description><![CDATA[The SQL Server 2012 introduced the new CONCAT function for the concatenation of the string and integer value. Previously, we were doing concatenation using &#8216;+&#8217; operator and using COALESCE(). But this newly introduced CONCAT() is faster than any other approach for the concatenation techniques. The syntax of CONCAT(): [crayon-6abb11fe0af3c869821477/] Different example of CONCAT(): CONCAT string [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&amp;linkname=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-2012-the-amazing-concat-function-for-string-concatenation%2F&#038;title=SQL%20Server%202012%3A%20The%20Amazing%20CONCAT%20function%20for%20string%20concatenation" data-a2a-url="https://www.dbrnd.com/2016/03/sql-server-2012-the-amazing-concat-function-for-string-concatenation/" data-a2a-title="SQL Server 2012: The Amazing CONCAT function for string concatenation"></a></p><p>The SQL Server 2012 introduced the new CONCAT function for the concatenation of the string and integer value. </p>
<p>Previously, we were doing concatenation using &#8216;+&#8217; operator and using COALESCE().<br />
But this newly introduced CONCAT() is faster than any other approach for the concatenation techniques. </p>
<p><strong>The syntax of CONCAT():</strong></p><pre class="crayon-plain-tag">CONCAT ( string_value1, string_value2 [, string_valueN ])</pre><p> </p>
<p><strong>Different example of CONCAT():</strong></p>
<p><strong>CONCAT string values:</strong></p>
<pre class="crayon-plain-tag">SELECT CONCAT('Database ','Research ','&amp; ','Development') AS ConcatString

ConcatString
-------------------------------
Database Research &amp; Development

(1 row(s) affected)</pre> </p>
<p><strong>CONCAT integer values:</strong></p>
<pre class="crayon-plain-tag">SELECT CONCAT(8,8,2) AS ConcatInteger

ConcatInteger
----------------
882

(1 row(s) affected)</pre> </p>
<p><strong>CONCAT decimal values:</strong></p>
<pre class="crayon-plain-tag">SELECT CONCAT(25.36,4.8) AS ConcatDecimal

ConcatDecimal
-------------------------------------------
25.364.8

(1 row(s) affected)</pre> </p>
<p><strong>CONCAT with NULL:</strong></p>
<pre class="crayon-plain-tag">SELECT CONCAT('Database Research ','&amp; Development',NULL) AS ConcatStringWithNull

ConcatStringWithNull
-------------------------------
Database Research &amp; Development

(1 row(s) affected)</pre> </p>
<p><strong>Invalid CONCAT parameters:</strong></p>
<pre class="crayon-plain-tag">SELECT CONCAT('Database Research &amp; Development ') AS ConcatError
Msg 189, Level 15, State 1, Line 1
The concat function requires 2 to 254 arguments.</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
