<?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: Find the Median Value from the Given Number	</title>
	<atom:link href="https://www.dbrnd.com/2018/05/sql-puzzle-find-the-median-value-from-the-given-number/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-median-value-from-the-given-number/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 30 Oct 2019 13:57:32 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: koustav modak		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-median-value-from-the-given-number/#comment-7864</link>

		<dc:creator><![CDATA[koustav modak]]></dc:creator>
		<pubDate>Wed, 30 Oct 2019 13:57:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7504#comment-7864</guid>

					<description><![CDATA[select  Number from 
(select row_number() over() as t,
* from tbl_TestMedian   )T1
where t =(

select (count(1)+1)/2 from tbl_TestMedian )]]></description>
			<content:encoded><![CDATA[<p>select  Number from<br />
(select row_number() over() as t,<br />
* from tbl_TestMedian   )T1<br />
where t =(</p>
<p>select (count(1)+1)/2 from tbl_TestMedian )</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dpan		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-median-value-from-the-given-number/#comment-6979</link>

		<dc:creator><![CDATA[Dpan]]></dc:creator>
		<pubDate>Mon, 15 Apr 2019 09:12:04 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7504#comment-6979</guid>

					<description><![CDATA[declare @count int
 select @count=count(*)/2 from #tbl_TestMedian 
 ;WITH Ordered AS (
 select ROW_NUMBER() Over (Order By Number) as rno,NUmber from #tbl_TestMedian
 )
 select * from Ordered where rno=@count]]></description>
			<content:encoded><![CDATA[<p>declare @count int<br />
 select @count=count(*)/2 from #tbl_TestMedian<br />
 ;WITH Ordered AS (<br />
 select ROW_NUMBER() Over (Order By Number) as rno,NUmber from #tbl_TestMedian<br />
 )<br />
 select * from Ordered where rno=@count</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcel Hofman		</title>
		<link>https://www.dbrnd.com/2018/05/sql-puzzle-find-the-median-value-from-the-given-number/#comment-6924</link>

		<dc:creator><![CDATA[Marcel Hofman]]></dc:creator>
		<pubDate>Fri, 22 Mar 2019 14:25:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7504#comment-6924</guid>

					<description><![CDATA[--using @@rowcount

DECLARE @rowcount INT
SET @rowcount = @@ROWCOUNT
; WITH CTE AS 
(
SELECT *, ROW_NUMBER () OVER (ORDER BY number) n FROM tbl_testmedian
)
SELECT *  FROM CTE WHERE n =  (@rowcount + 1) / 2]]></description>
			<content:encoded><![CDATA[<p>&#8211;using @@rowcount</p>
<p>DECLARE @rowcount INT<br />
SET @rowcount = @@ROWCOUNT<br />
; WITH CTE AS<br />
(<br />
SELECT *, ROW_NUMBER () OVER (ORDER BY number) n FROM tbl_testmedian<br />
)<br />
SELECT *  FROM CTE WHERE n =  (@rowcount + 1) / 2</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
