강의

멘토링

커뮤니티

Inflearn Community Q&A

rmh03130151's profile image
rmh03130151

asked

Database - SQL

trigger

트리거 부분은 MySQL에서는 어떻게 구현해야하나요?

Written on

·

284

0

강의 소개에 MySQL을 사용해도 무방하다고 해서 MySQL로 실습하고 있었는데요. SQL 문법상 약간의 차이점은 있었지만 큰 어려움 없이 여기까지 왔는데, 트리거에서는 좀 막히네요. 구글링도 하면서 만들어본 쿼리가 

CREATE TRIGGER updateCustomerCategory

AFTER INSERT

ON customer for each row

begin 

update customer 

set CustomerCategory = concat(CustomerGroupId, CustomerGroupDetailId)

where CustomerId = new.CustomerId

end

위와 같은데요. 실행시키면 end 근처에서 syntax error가 있다는 말만 나오고 정확히 뭐가 문제인지는 나오지 않는데 어떻게 해결해야하나요? 

데이터 엔지니어링sql

Answer

This question is waiting for answers
Be the first to answer!
rmh03130151's profile image
rmh03130151

asked

Ask a question