mysql - Can I use alias when inserting to values ON DUPLICATE KEY UPDATE value -
i error when using alias in on duplicate key update.
"insert currentweekvalue (symbol,value) select csymbol , totval (select currentweekvalue.symbol csymbol,(currentweekvalue.value + $dayiterated.value) totval currentweekvalue left join $dayiterated on currentweekvalue.symbol = $dayiterated.symbol ) sub on duplicate key update value = values(sub.totval)"; the error unknown column 'sub.totval' in 'field list' possible use alias on values? if not there other way around?
Comments
Post a Comment