Need to insert two columns from one table another only if th
Posted: Fri May 02, 2014 2:43 am
I want to enhance this mysql sql statement so that the two columns are only inserted if they don't already exist as a pair in the table.
insert into ingredient_owner (ingredient,owner) select distinct ing, (select owner from recipe where id=recipe_ing.recipe) as owner from recipe_ing where ing is not null;
insert into ingredient_owner (ingredient,owner) select distinct ing, (select owner from recipe where id=recipe_ing.recipe) as owner from recipe_ing where ing is not null;