<?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; Remove all NULL value and arrange other NON NULL	</title>
	<atom:link href="https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sat, 04 May 2019 11:04:17 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Lakshman		</title>
		<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-7096</link>

		<dc:creator><![CDATA[Lakshman]]></dc:creator>
		<pubDate>Sat, 04 May 2019 11:04:17 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6654#comment-7096</guid>

					<description><![CDATA[select max(col1) as col1,max(col2) as col2,max(col3) as col3,max(col4) as col4 from tbl_Numbers]]></description>
			<content:encoded><![CDATA[<p>select max(col1) as col1,max(col2) as col2,max(col3) as col3,max(col4) as col4 from tbl_Numbers</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ankush		</title>
		<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-6701</link>

		<dc:creator><![CDATA[Ankush]]></dc:creator>
		<pubDate>Fri, 14 Sep 2018 09:45:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6654#comment-6701</guid>

					<description><![CDATA[Select sum(col1) as col1, sum(col2) as col2 from
(Select distinct coalesce(col1,0)as col1 ,coalesce(col2,0)as col2 from  (
Select 10 as col1, NULL as col2 from dual
UNION
Select NULL as col1, 20 as col2 from dual)foo)

Situation would be different when there are no numbers but characters!!]]></description>
			<content:encoded><![CDATA[<p>Select sum(col1) as col1, sum(col2) as col2 from<br />
(Select distinct coalesce(col1,0)as col1 ,coalesce(col2,0)as col2 from  (<br />
Select 10 as col1, NULL as col2 from dual<br />
UNION<br />
Select NULL as col1, 20 as col2 from dual)foo)</p>
<p>Situation would be different when there are no numbers but characters!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anvesh Patel		</title>
		<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-6034</link>

		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 23 Nov 2017 12:43:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6654#comment-6034</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-6031&quot;&gt;Dinesh I.S&lt;/a&gt;.

Thanks that you corrected :)]]></description>
			<content:encoded><![CDATA[<p>Thanks that you corrected 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dinesh I.S		</title>
		<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-6031</link>

		<dc:creator><![CDATA[Dinesh I.S]]></dc:creator>
		<pubDate>Thu, 23 Nov 2017 10:18:12 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6654#comment-6031</guid>

					<description><![CDATA[Hi Sir 

We are getting wrong result please check the once. 

Col1:-20 but in your  result showing 10 

SELECT
 [1] as Col1, [2] as Col2, [3] as Col3, [4] as Col4
FROM
(SELECT isnull(Col1,0)+isnull(Col2,0)+isnull(Col3,0)+isnull(Col4,0) as SumAll,ROW_NUMBER () over (order by (select 0)) as  t
    FROM tbl_Numbers ) AS SourceTable
PIVOT
(
sum(SumAll)
FOR t IN ( [1], [2], [3], [4])
) AS PivotTable]]></description>
			<content:encoded><![CDATA[<p>Hi Sir </p>
<p>We are getting wrong result please check the once. </p>
<p>Col1:-20 but in your  result showing 10 </p>
<p>SELECT<br />
 [1] as Col1, [2] as Col2, [3] as Col3, [4] as Col4<br />
FROM<br />
(SELECT isnull(Col1,0)+isnull(Col2,0)+isnull(Col3,0)+isnull(Col4,0) as SumAll,ROW_NUMBER () over (order by (select 0)) as  t<br />
    FROM tbl_Numbers ) AS SourceTable<br />
PIVOT<br />
(<br />
sum(SumAll)<br />
FOR t IN ( [1], [2], [3], [4])<br />
) AS PivotTable</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dinesh I.S		</title>
		<link>https://www.dbrnd.com/2017/11/sql-puzzle-sql-advance-query-remove-all-null-value-and-arrange-other-non-null/#comment-6030</link>

		<dc:creator><![CDATA[Dinesh I.S]]></dc:creator>
		<pubDate>Thu, 23 Nov 2017 10:14:51 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6654#comment-6030</guid>

					<description><![CDATA[Select * From tbl_Numbers
UNPIVOT(Orders For Description In(Col1,Col2,Col3,Col4))A 
PIVOT(Max(Orders) For Description In([Col1],[Col2],[Col3],[Col4])) A]]></description>
			<content:encoded><![CDATA[<p>Select * From tbl_Numbers<br />
UNPIVOT(Orders For Description In(Col1,Col2,Col3,Col4))A<br />
PIVOT(Max(Orders) For Description In([Col1],[Col2],[Col3],[Col4])) A</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
