now is better than never
[Level 2][SELECT] 3월에 태어난 여성 회원 목록 출력하기 (SQL 날짜 월 출력) 본문
MySQL
SELECT member_id, member_name, gender
, date_format(date_of_birth, '%Y-%m-%d') date_of_birth
from member_profile
where month(date_of_birth) = 3
and gender = 'W'
and tlno is not null
order by member_id
Oracle
SELECT member_id, member_name, gender
, to_char(date_of_birth, 'YYYY-MM-DD') date_of_birth
from member_profile
where extract(month from date_of_birth) = 3
and gender = 'W'
and tlno is not null
order by member_id;
'프로그래머스 > SQL' 카테고리의 다른 글
[LEVEL 2][String, Date] 자동차 평균 대여 기간 구하기 (0) | 2023.05.15 |
---|---|
[Level 4][SELECT] 서울에 위치한 식당 목록 출력하기 (0) | 2023.01.04 |
[Level 4][JOIN] 보호소에서 중성화한 동물 (0) | 2023.01.03 |
[Level 4][GROUP BY] 저자 별 카테고리 별 매출액 집계하기 (0) | 2023.01.03 |
[Level 4][GROUP BY] 입양시각 구하기 (2) ([Oracle] 0에서 23 까지 숫자 생성) (0) | 2023.01.03 |