회원명부가 있는데요.. 거기서 19xx-xx-xx로 되어야 하는데, 20xx-xx-xx로 되어있는 회원이 있거든요..
그걸 한꺼번에 바꿔주려고 하는데요..
update member set birth_date ( ? ) where birth_date LIKE '20%'
자주 사용을 안하는지라 간단한 쿼리문도 잘 몰라서리..^^;;
도움 좀 부탁드릴께요~~
to_date 라는 함수가 있나요?에공..ㅠ 함수를 무작정 좀 뒤져봐서 잘라넣을 방법을 생각해봐야 겠네요.. 감사합니다....^^
1. birth_date 의 칼럼 type 이 varchar 또는 char 일 경우
update member set birth_date = concat( '19' , substring( birth_date , 3 ) ) where birth_date LIKE '20%';
2. birth_date 의 칼럼 type 이 date 일 경우
update member set birth_date = date_add( birth_date, INTERVAL -100 year ) where birth_date >= '2000-01-01';