본문 바로가기
알고리즘

[프로그래머스] 3월에 태어난 여성 회원 목록 출력하기 - sql

by 육빔 2024. 4. 1.
728x90
반응형

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

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

여자인 경우, 3월인 경우, 전화번호가 NULL이 아닌 경우를 그룹 아이디로 오름차순으로 정렬하는 sql문

date_format은 형식을 맞춰줘야 정답으로 처리한다.

select member_id, member_name, gender, date_format(date_of_birth, '%Y-%m-%d') date_of_birth
from member_profile
where tlno is not null
and month(date_of_birth) = 3
and gender = 'W'
order by member_id;

 

728x90
반응형