문제
내가 작성한 정답
MySQL
select games,count(distinct id) num
from olympics_athletes_events
group by games,season, year
order by num desc
limit 1;PostgreSQL
select games,count(distinct id) num
from olympics_athletes_events
group by games,season, year
order by num desc
limit 1;
select games,count(distinct id) num
from olympics_athletes_events
group by games,season, year
order by num desc
fetch first 1 row only;Oracle
select games,count(distinct id) num
from olympics_athletes_events
group by games,season, year
order by num desc
fetch first 1 row only;
select games, num
from (select games,count(distinct id) num
from olympics_athletes_events
group by games,season, year
order by num desc)
where rownum =1;
Share article