[프로그래머스, 301647] 부모의 형질을 모두 가지는 대장균 찾기 (mysql)
Problem Solving/Programmers

[프로그래머스, 301647] 부모의 형질을 모두 가지는 대장균 찾기 (mysql)

728x90

https://school.programmers.co.kr/learn/courses/30/lessons/301647

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr


select my.id as id, my.genotype as genotype, p.genotype as parent_genotype
from ecoli_data as my
left join ecoli_data as p
on my.parent_id = p.id
where bin(my.genotype & p.genotype) = bin(p.genotype)
order by my.id;
728x90