LeetCode 178: Rank Scores [SQL]
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- Solution and walkthrough of leetcode database problem 178: Rank Scores I'm using MySQL but this solution should work in any SQL dialect such as PostgreSQL SQL Server, etc.
Link to the problem: leetcode.com/p...
Check out my StrataScratch videos: • StrataScratch Coding Q...
If you want to have access to more free SQL problems, check out StrataScratch: stratascratch.com/?via=frederik
select a.score, count(DISTINCT b.score) as "Rank" from Scores a join Scores b
on a.score
NOTES:Rank will produce 1,1,3; Dense Rank produce 1,1,2
exactly
thanks for this
I love the second you explained. Thank you!
Love the second explaination.
learned a lot in this actually!!! (concept of separating table and comparison)
thank you for your content
Solution 2 is good for me🐱
Thank you!! Great video!
how count function works without group by clause ....please explain,very confused...
Helpful video
why newly created column rank should be added with " "? thx!
well explained