[MySQL] SQL 날짜와 시간 처리하는 함수들 _ dayofweek(), now(), curdate(), date_add(), date_sub()
날짜와 시간 처리하기 DB에서 년, 월, 일 다루기 _birthdate = DATE- day(), month(), year(), dayname(), dayofweek() -- 날짜만 가져올때select name, day( birthdate )from people;-- 월만 가져올때select name, month( birthdate )from people;-- 년도만 가져올때select name, year( birthdate )from people;-- 요일을 문자열로 가져올때select name, dayname( birthdate )from people;-- 요일을 숫자로 가져올때 _글로벌하게 사용하기 위해서 숫자로 사용한다.-- 각 국가의 언어로 클라이언트 개발자가 숫자에서 글로 바뀌게 만든다.se..
2024. 5. 16.