Skip to content

SQL Practice 13

1. 문제 [[object Object]]

환자의 고유한 출생 연도를 표시하고 오름차순으로 정렬합니다.

patient_idfirst_namelast_namegenderbirth_datecityprovince_idallergiesheightweight
1DonaldWaterfieldM1963-02-12BarrieONNULL15665
2MickeyBaashaM1981-05-28DundasONSulfa18576
3JijiSharmaM1957-09-05HamiltonONPenicillin194106
4BlairDiazM1967-01-07HamiltonONNULL191104
5CharlesWolfeM2017-11-19OrilliaONPenicillin4710
6SueFalconF2017-09-30AjaxONPenicillin435

2. 정답

SELECT DISTINCT YEAR(birth_date) AS birth_year
FROM patients
order by birth_date ASC;

3. 결과

birth_year
1957
1963
1967
1981
2017