Grazie,
ho provato inserendo il codice nella console SQL di phpMyAdmin, ottenendo questo output:

codice:
SET @var = ( SELECT code
FROM tbl1
WHERE row =40 ) ;# MySQL ha restituito un insieme vuoto (i.e. zero righe).
UPDATE tbl1 SET code = @var WHERE row =50;# Righe interessate: 1
Da cui sembrerebbe che la prima subquery "SELECT code FROM tbl1 WHERE row=40" non restituisce nulla, mentre invece se inviata singolarmente restituisce una riga contenente la giusta stringa.