[mysql/oracle] 3월에 태어난 여성 회원 목록 출력하기

2023. 2. 3. 22:26Programmers/SQL

문제

 

결과

 

mysql

1
2
3
4
5
6
7
SELECT member_id, member_name, gender
       , date_format(date_of_birth, '%Y-%m-%d') date_of_birth
from member_profile
where gender = 'W' 
      and month(date_of_birth) = '03' 
      and tlno is not null
order by member_id
cs

 

oracle

1
2
3
4
SELECT member_id, member_name, gender
, to_char(date_of_birth, 'yyyy-mm-dd') date_of_birth
from member_profile
where gender = 'W' 
and to_char(date_of_birth, 'mm'= '03' 
and tlno is not null
order by member_id
cs