<?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: MySQL query to find the second highest salary	</title>
	<atom:link href="https://www.thecodedeveloper.com/second-highest-salary-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thecodedeveloper.com/second-highest-salary-mysql/</link>
	<description>The Code Developer is a Programming Blog.</description>
	<lastBuildDate>Thu, 24 Jan 2019 20:41:30 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>
		By: Full Stack developer		</title>
		<link>https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-1527</link>

		<dc:creator><![CDATA[Full Stack developer]]></dc:creator>
		<pubDate>Wed, 25 Jul 2018 12:41:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2188#comment-1527</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-1516&quot;&gt;Rajesh&lt;/a&gt;.

you are right. thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-1516">Rajesh</a>.</p>
<p>you are right. thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rajesh		</title>
		<link>https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-1516</link>

		<dc:creator><![CDATA[Rajesh]]></dc:creator>
		<pubDate>Tue, 24 Jul 2018 17:53:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2188#comment-1516</guid>

					<description><![CDATA[How about 

SELECT * FROM employees ORDER BY salary DESC limit 1,1;]]></description>
			<content:encoded><![CDATA[<p>How about </p>
<p>SELECT * FROM employees ORDER BY salary DESC limit 1,1;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Full Stack developer		</title>
		<link>https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-1268</link>

		<dc:creator><![CDATA[Full Stack developer]]></dc:creator>
		<pubDate>Sun, 10 Jun 2018 18:20:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2188#comment-1268</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-757&quot;&gt;Kamal Nayan&lt;/a&gt;.

Use below MySql Query to find Nth highest employee salary from an employees table

[php]
SELECT *
FROM employees Emp1
WHERE ( n ) = (
                SELECT COUNT( DISTINCT ( Emp2.salary ) )
                FROM employees Emp2
                WHERE Emp2.salary &#062;= Emp1.salary
            );
[/php]

Here, replace the n with any number. For example, if you have to find 10th highest salary , then replace n with 10 like below query -

[php]
SELECT *
FROM employees Emp1
WHERE 10 = (
                SELECT COUNT( DISTINCT ( Emp2.salary ) )
                FROM employees Emp2
                WHERE Emp2.salary &#062;= Emp1.salary
            );
[/php]]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-757">Kamal Nayan</a>.</p>
<p>Use below MySql Query to find Nth highest employee salary from an employees table</p>
<pre class="brush: php; title: ; notranslate">
SELECT *
FROM employees Emp1
WHERE ( n ) = (
                SELECT COUNT( DISTINCT ( Emp2.salary ) )
                FROM employees Emp2
                WHERE Emp2.salary &gt;= Emp1.salary
            );
</pre>
<p>Here, replace the n with any number. For example, if you have to find 10th highest salary , then replace n with 10 like below query &#8211;</p>
<pre class="brush: php; title: ; notranslate">
SELECT *
FROM employees Emp1
WHERE 10 = (
                SELECT COUNT( DISTINCT ( Emp2.salary ) )
                FROM employees Emp2
                WHERE Emp2.salary &gt;= Emp1.salary
            );
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kamal Nayan		</title>
		<link>https://www.thecodedeveloper.com/second-highest-salary-mysql/#comment-757</link>

		<dc:creator><![CDATA[Kamal Nayan]]></dc:creator>
		<pubDate>Wed, 23 May 2018 14:56:13 +0000</pubDate>
		<guid isPermaLink="false">https://www.thecodedeveloper.com/?p=2188#comment-757</guid>

					<description><![CDATA[What will you do for nth highest (say 10th)? Don&#039;t use LIMIT.]]></description>
			<content:encoded><![CDATA[<p>What will you do for nth highest (say 10th)? Don&#8217;t use LIMIT.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
