-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Description
Bug Report for https://neetcode.io/problems/sql-aggregation-execution-order
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
In order by we can use alias which already defined in select since select is working before order by.
Following solution is enough
select country, year, SUM(gold + silver + bronze) as total_medals from olympic_medals
where category !='Gymnastics'
group by country,year
having sum(gold+silver+bronze) > 20
order by total_medals desc
limit 5
Metadata
Metadata
Assignees
Labels
No labels