<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: SQL Puzzle: SQL Advance Query &#8211; Get the DISTINCT String data after CONCAT	</title>
	<atom:link href="https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sat, 02 Nov 2019 06:50:42 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>
		By: koustav Modak		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comment-7872</link>

		<dc:creator><![CDATA[koustav Modak]]></dc:creator>
		<pubDate>Sat, 02 Nov 2019 06:50:42 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219#comment-7872</guid>

					<description><![CDATA[select array_to_string(array_agg(replace(replace(result::text,&#039;(&#039;,&#039;&#039;),&#039;)&#039;,&#039;&#039;)), &#039;,&#039;) rel_name 
from
(select distinct strname from tbl_strings order by 1)result]]></description>
			<content:encoded><![CDATA[<p>select array_to_string(array_agg(replace(replace(result::text,'(&#8216;,&#8221;),&#8217;)&#8217;,&#8221;)), &#8216;,&#8217;) rel_name<br />
from<br />
(select distinct strname from tbl_strings order by 1)result</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: HIC		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comment-7055</link>

		<dc:creator><![CDATA[HIC]]></dc:creator>
		<pubDate>Sun, 28 Apr 2019 08:05:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219#comment-7055</guid>

					<description><![CDATA[declare
  s varchar2(255) := &#039;&#039;;
begin
  for c in (select distinct strname from tbl_strings)
  loop
    s := s &#124;&#124; c.strname &#124;&#124; &#039;, &#039;;
  end loop;    
  
  s := rtrim(s, &#039;, &#039;);
  
  dbms_output.put_line(s);
end;]]></description>
			<content:encoded><![CDATA[<p>declare<br />
  s varchar2(255) := &#8221;;<br />
begin<br />
  for c in (select distinct strname from tbl_strings)<br />
  loop<br />
    s := s || c.strname || &#8216;, &#8216;;<br />
  end loop;    </p>
<p>  s := rtrim(s, &#8216;, &#8216;);</p>
<p>  dbms_output.put_line(s);<br />
end;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dpan		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comment-6982</link>

		<dc:creator><![CDATA[Dpan]]></dc:creator>
		<pubDate>Tue, 16 Apr 2019 04:44:51 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219#comment-6982</guid>

					<description><![CDATA[SELECT Distinct(strname) as strname into #tbl_strings3 from #tbl_strings

select ROW_NUMBER() over (Order by strname) as rownumber, strname into #tbl_strings4 from #tbl_strings3
Declare @i int,@str nvarchar(max) ; set @i=1;set @str=&#039;&#039;;
while (@i&#060;=4)
begin
select @str=Concat(@str,strname,&#039;,&#039;) from #tbl_strings4 where rownumber=@i
print @str;
set @i=@i+1;
end]]></description>
			<content:encoded><![CDATA[<p>SELECT Distinct(strname) as strname into #tbl_strings3 from #tbl_strings</p>
<p>select ROW_NUMBER() over (Order by strname) as rownumber, strname into #tbl_strings4 from #tbl_strings3<br />
Declare @i int,@str nvarchar(max) ; set @i=1;set @str=&#8221;;<br />
while (@i&lt;=4)<br />
begin<br />
select @str=Concat(@str,strname,&#039;,&#039;) from #tbl_strings4 where rownumber=@i<br />
print @str;<br />
set @i=@i+1;<br />
end</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ankush		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comment-6696</link>

		<dc:creator><![CDATA[Ankush]]></dc:creator>
		<pubDate>Fri, 14 Sep 2018 08:07:18 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219#comment-6696</guid>

					<description><![CDATA[Select LISTAGG(strname, &#039;,&#039;) WITHIN GROUP (ORDER BY strname) 
from 
(Select distinct strname from table)foo]]></description>
			<content:encoded><![CDATA[<p>Select LISTAGG(strname, &#8216;,&#8217;) WITHIN GROUP (ORDER BY strname)<br />
from<br />
(Select distinct strname from table)foo</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sandeep		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-get-the-distinct-string-data-after-concat/#comment-6537</link>

		<dc:creator><![CDATA[Sandeep]]></dc:creator>
		<pubDate>Wed, 18 Jul 2018 07:35:03 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7219#comment-6537</guid>

					<description><![CDATA[SELECT CAST(Abs(rand()*100) AS INT)%50]]></description>
			<content:encoded><![CDATA[<p>SELECT CAST(Abs(rand()*100) AS INT)%50</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
