I made a schema example: http://sqlfiddle.com/#!3/6a134/1
Let's say I have a table called cart which contains customer_id's and item codes they want to buy.
I want to add Item "ZZZ" for any order currently in table cart that has item "ABC".
Is there a way to do with with a single SQL command?
The only way I know how to do this is if I wrote a stored procedure with a cursor and inserted a row for every customer id I find in the cart meeting my requirements.
Thanks!