<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need SQl help in SQL database</title>
    <link>https://community.fabric.microsoft.com/t5/SQL-database/Need-SQl-help/m-p/5335698#M735</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="752610" data-lia-user-login="powerbidev123" class="lia-mention lia-mention-user"&gt;powerbidev123​&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;You can use a subquery to find the maximum salary that is lower than the overall maximum salary:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT MAX(salary) AS second_highest_salary FROM Employee WHERE salary &amp;lt; (     SELECT MAX(salary)     FROM Employee );&lt;/LI-CODE&gt;&lt;P&gt;The inner query finds the highest salary. The outer query then finds the highest salary below that value, which gives you the second-highest distinct salary.&lt;/P&gt;&lt;P&gt;This also handles duplicate highest salaries correctly.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;AI-assisted drafting:&lt;/STRONG&gt; AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Sat, 29 Aug 2026 17:29:33 GMT</pubDate>
    <dc:creator>ShivekMaharaj</dc:creator>
    <dc:date>2026-08-29T17:29:33Z</dc:date>
    <item>
      <title>Need SQl help</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Need-SQl-help/m-p/5335496#M732</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with a SQL problem as desc below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Find the second highest salary from an Employee table without using LIMIT, TOP, or window functions.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Aug 2026 13:31:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Need-SQl-help/m-p/5335496#M732</guid>
      <dc:creator>powerbidev123</dc:creator>
      <dc:date>2026-08-02T13:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need SQl help</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/Need-SQl-help/m-p/5335698#M735</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="752610" data-lia-user-login="powerbidev123" class="lia-mention lia-mention-user"&gt;powerbidev123​&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;You can use a subquery to find the maximum salary that is lower than the overall maximum salary:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT MAX(salary) AS second_highest_salary FROM Employee WHERE salary &amp;lt; (     SELECT MAX(salary)     FROM Employee );&lt;/LI-CODE&gt;&lt;P&gt;The inner query finds the highest salary. The outer query then finds the highest salary below that value, which gives you the second-highest distinct salary.&lt;/P&gt;&lt;P&gt;This also handles duplicate highest salaries correctly.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;AI-assisted drafting:&lt;/STRONG&gt; AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 29 Aug 2026 17:29:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/Need-SQl-help/m-p/5335698#M735</guid>
      <dc:creator>ShivekMaharaj</dc:creator>
      <dc:date>2026-08-29T17:29:33Z</dc:date>
    </item>
  </channel>
</rss>

