주민등록 번호로 나이,나이대 구하기
- 나이 구하기 (jumin_no:주민등록 번호 000000-0000000 형식) select year(now()) - (if (mid(jumin_no, 8, 1) = '1' or mid(jumin_no, 8, 1) = '2', 1900, 2000) +left(jumin_no, 2)) + 1 as age from member - 나이대 구하기 (jumin_no:주민등록 번호 000000-0000000 형식) select age, count(age) as cnt from ( select floor((year(now()) - (if (mid(jumin_no, 8, 1) = '1' or mid(jumin_no, 8, 1) = '2', 1900, 2000) +left(jumin_no, 2)) + 1)/10)*1..
더보기