테스트 사이트 - 개발 중인 베타 버전입니다

service_edate='date_sub(2016-04-22, interval 1 year)' 도대체 이 구문이 왜 틀리는거죠? ㅠ,ㅠ 채택완료

amkorDB 9년 전 조회 2,264

update 테이블 set  service_sdate='2016-04-22', service_edate='date_sub(2016-04-22, interval 1 year)' where no=75 

 

일단 에러 없이 sql 실행 되는데

 

db확인 해보면 service_edate 필드 값이 초기화 됩니다 ㅠ,ㅠ

 

도대체 머가 틀리는거지 ㅠ,ㅠ

댓글을 작성하려면 로그인이 필요합니다.

답변 4개

채택된 답변
+20 포인트

update 테이블 set  service_sdate='2016-04-22', service_edate='date_sub(2016-04-22, interval 1 year)' where no=75 

 

에서  service_edate=date_sub ? 

date_sub에  ''가 붙어 있네요.^^

 

service_edate='date_sub(2016-04-22, interval 1 year)'

service_edate=date_sub(2016-04-22, interval 1 year)

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

9년 전

date_sub 의 첫번째 인자가 문자형으로 들어가야 할 것 같은데요. 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

백영진
9년 전

service_edate=date_sub('2016-04-22', interval 1 year) 이렇게 써줘야 되는것 같은데요 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

service_edate='date_sub(2016-04-22, interval 1 year)'

여기 따옴표를 빼셔야...

service_edate=date_sub('2016-04-22', interval 1 year) 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인