[프로그래머스] 특정 세대의 대장균 찾기

yenpkr·2025년 3월 10일
0

sql

목록 보기
47/91

문제

제출

select id
from ecoli_data
where parent_id in (SELECT id
from ecoli_data
where parent_id in (select id from ecoli_data where parent_id is null))
order by 1 asc

또 다른 답

select c.id
from ecoli_data a
join ecoli_data b on a.id = b.parent_id
join ecoli_data c on b.id = c.parent_id
where a.parent_id is null
order by 1 asc

0개의 댓글