[Q] UPDATE-FROM in Sybase ASE 12.5 -
01-09-2004
, 01:01 PM
Could somebody please help me out with UPDATE-FROM ?
My table 'Rates' has a structure:
currency_id_1 int
currency_id_2 int
rate float
flag boolean
I'm trying to recalculate rates for all the entries marked by flag=1
using the rates from THE SAME table:
update Rates set rate = t1.rate * t2.rate from Rates t1, Rates t2
where currency_id_1 = t1.currency_id_1
and t1.currency_id_2 = t2.currency_id_1
and t2.currency_id_2 = currency_id_2
and flag = 1
Sybase ASE 12.5 complains with:
Ambiguous column name currency_id_1
What a problem here? How to bypass that (without temporary tables)?
Thanks,
Aleksey |