0
table:
name date object
james 25/04/2017 bycicle
insert into statisticstable
select * from table;
통계 테이블에 이름과 날짜가없는 경우에만 테이블 통계를 업데이트하는 함수를 작성하고 싶습니다. 통계 테이블에 이름과 날짜가있는 경우 테이블 통계를 업데이트하지 않습니다. 그렇지 않은 경우 통계 테이블에 이름과 날짜가없는 경우 테이블 통계가 업데이트됩니다. 이 같은그러면 함수가 테이블을 업데이트합니까?
뭔가 :
CREATE FUNCTION update_table()
DECLARE
name = &name
date = &date
if &name and &date are in statisticstable
then null;
if &name and &date aren't in statisticstable
insert into statisticstable
select * from table;
실례하지만 기능에 대한 전문가가 아니다.
Refre 탐색이 - https://stackoverflow.com/questions/1009584/how-to-emulate-insert-ignore-and-on-duplicate-key-update-sql-merge 함께 –