How to I can create a query for update, if select result is bigger then 0, else execute insert?
I had try execute this code, but is not work
select
case
where count(id) > 0 (update product set description = 'blablabla' where id_fk1 = 3 AND id_fk2 = 4)
else (insert into product (description) values('blablabla')
end
I know this is a select code, it will not work, but I don't know how to use If in mysql