dbTalk Databases Forums  

[Q] UPDATE-FROM in Sybase ASE 12.5

comp.databases.sybase comp.databases.sybase


Discuss [Q] UPDATE-FROM in Sybase ASE 12.5 in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alex
 
Posts: n/a

Default [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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.