From f7786a4d7aac600e387bdf0461bdc123d79c45c8 Mon Sep 17 00:00:00 2001 From: Krishna Pradeep Dawalkar <67512104+Krishna-Pradeep-Dawalkar@users.noreply.github.com> Date: Thu, 21 Oct 2021 11:25:50 +0530 Subject: [PATCH 1/2] Solved Query-33 Issue #20 Created Query-33 Issue #20 to solve the assigned issue to me i.e. Solved Query-33 Issue #20. --- Problems/Query-33 Issue-#20/Query-33 Issue-#20.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Problems/Query-33 Issue-#20/Query-33 Issue-#20.md diff --git a/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md b/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md new file mode 100644 index 0000000..af96125 --- /dev/null +++ b/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md @@ -0,0 +1,9 @@ +SELECT * FROM Employee WHERE sal = + ( + SELECT MIN(sal) FROM Employee + WHERE sal IN ( + SELECT DISTINCT TOP N + sal FROM Employee + ORDER BY sal DESC + ) + ) From 7e547785dec8503e1c13f99ac4dea3bbcaf40f7a Mon Sep 17 00:00:00 2001 From: Krishna Pradeep Dawalkar <67512104+Krishna-Pradeep-Dawalkar@users.noreply.github.com> Date: Thu, 28 Oct 2021 20:24:14 +0530 Subject: [PATCH 2/2] Updated file as per the changes expected. Updated as per the changes expected and replaced the employee table by table(generalized one). --- Problems/Query-33 Issue-#20/Query-33 Issue-#20.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md b/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md index af96125..120b35c 100644 --- a/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md +++ b/Problems/Query-33 Issue-#20/Query-33 Issue-#20.md @@ -1,9 +1,9 @@ -SELECT * FROM Employee WHERE sal = +SELECT * FROM table WHERE salary = ( - SELECT MIN(sal) FROM Employee - WHERE sal IN ( + SELECT MIN(salary) FROM table + WHERE salary IN ( SELECT DISTINCT TOP N - sal FROM Employee - ORDER BY sal DESC + salary FROM table + ORDER BY salary DESC ) )