table:
name date object
james 25/04/2017 bycicle
insert into statisticstable
select * from table;
I want to write a function that update the table statistics only if name and date are not already in statistics table. If in statistics table there are name and date not update the table statistics, otherwise if in statistics table there aren't name and date update the table statistics.
Something like this:
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;
Excuse me but I am not an expert on functions.