I have: something like
UPDATE table
SET field = (SELECT field FROM another_table WHERE id = @id);
Problem: SELECT field FROM another_table WHERE id = @id subquery can return one field or EMPTY SET.
Question: How to handle situation when subquery returns empty set?
Updated:
UPDATE table t
SET field = IF((SELECT field FROM another_table WHERE id = @id) IS NOT NULL, -- select field
(SELECT field FROM another_table WHERE id = @id), -- Problem #1: select field AGAIN!
(SELECT field FROM table WHERE id = t.id) -- Problem #2: try to not change value, so select the current field value!!
);