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

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -