2nd Highest Salary || Nth Highest Salary || LIMIT keyword in SQL - Part 4
ฝัง
- เผยแพร่เมื่อ 14 ต.ค. 2024
- In this video, we will learn about how to find out 2nd highest salary and how to write a generic query to find out the nth highest salary from a table.
Learn:
-What is Max() function
-What is LIMIT Keyword
-How to find out 2nd highest salary using inner query and Max() function
-How to find out nth highest salary using LIMIT keyword
--What is TOP and ROWNUM in SQL.
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
WebServices API Automation Tutorials:
vimeo.com/onde... Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom... ➡️Get Our Courses✔️
📗 Get My Paid Courses at
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom...
-------------------------------
✔️SOCIAL NETWORKS
Facebook: / naveenqtpexpert
Twitter: / naveenkhunteta
Blog: www.naveenautom...
--------------------------------
Support My Channel✔️Or Buy Me A Coffee
Paypal: paypal.me/nave...
Google Pay: naveenanimation20@gmail.com
--------------------------------
✔️Thanks for watching!
देखने के लिए धन्यवाद
Благодаря за гледането
感谢您观看
Merci d'avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة
Thank you...Very nice explanation.... Very useful... I have asked about this fetching highest column in my recent interview...
very nice vedio very helpful need joins vedio too!!!
Hi Naveen, Thank you for such a nice video. just wanted to know how to write LIMIT command for second last salary for employee if we dont know the total number of rows .
Hello sir, i saw your SQL and automation videos they are really useful.sir i want you to make some videos on joins and other SQL queries that are asked in interviews
Sure I'll release them very soon.
Hi Naveen, Thanks for these videos. Kindly upload Foreign Key Constraint, Joins videos also.
I think, LIMIT is only supported for MySQL, I tried in Oracle 11g, it gives me error.
In Oracle we can write following query to find nth salary,
By Using function DENSE_RANK() :
select *
from
(
select
salary
,dense_rank() over (order by salary desc) ranking
from employees
)
where ranking = n ;
OR
By Using Co-related Subquery :
select distinct salary from employees a where n = (select count(distinct(salary)) from employees b
where b.salary >= a.salary) order by a.salary desc;
Hi Naveen, you are doing amazing videos for all series . thank you for sharing you knowledge . how can i get this SQL note ?
thx naveen@@ plz make some interview question for ma
nual testing@@
Hi naveen... Can u pls help me with this query.. Display the department name and total no of employees in each department...
Very nice and informative video.
Could you please share video on joins. It will be of great help.
superb Explanation Thank You for guidance
👍💐Informative video.
limit 3-1, 1;
how it gives 3rd highest salary, 3-1 = 2
it should give 2nd highest salary.
kindly clear my doubt naveen sir
Harshit do u know what is '1' doin here after , ?
@@John12685 1 is to specify that we want only one record of salary.
@@pranavkurkure6091 Oh alright pranav. I get it now. Thanku
And one more question whenever you write "varchar(225)" what is meaning of (225)? is it limit of numbers or characters ?
it means size of characters,if we specify varchar(3) ,it means i can store size of 3 characters. eg : abi,ram, pop etc
awesome :-)
Hi Naveen. I think your query will give the wrong result.if we have duplicate salary in the table
Sir please make video on python automation