문제 URL : https://solvesql.com/problems/max-row/

 

https://solvesql.com/problems/max-row/

 

solvesql.com

 

* 문제 저작권으로 인하여 직접 작성한 쿼리문만 첨부

select id from points
where x == (select max(x) from points)
or y == (select max(y) from points)
order by id

 

조건에서 사용될 각 열의 최댓값을 구하기 위해 서브쿼리 사용

값이 A열과 B열 중 하나에서라도 최댓값과 동일하면 포함시키기 위해 OR 연산자를 사용

+ Recent posts