Mysql-59409

codakcodak·2023년 2월 20일
0

프로그래머스-mysql

목록 보기
4/21

SELECT ANIMAL_ID,NAME,'O' as 중성화
from ANIMAL_INS
where SEX_UPON_INTAKE like '%Neutered%'
or SEX_UPON_INTAKE like '%Spayed%'
union
SELECT ANIMAL_ID,NAME,'X' as 중성화
from ANIMAL_INS
where SEX_UPON_INTAKE not like '%Neutered%'
and SEX_UPON_INTAKE not like '%Spayed%'
order by ANIMAL_ID

not like
특정 문자열을 포함하지 않는가

union
쿼리의 결과 합치기

  • union
    중복을 제거하면서 합치기
  • union all
    중복을 제거하지 않으면서 합치기
profile
숲을 보는 코더

0개의 댓글