Answer the question
In order to leave comments, you need to log in
How to query on three tables in SQL Server?
There are three tables: Credit_Rah, Valuta and Cred_zaborg. Valuta is associated with Credit_rah, Credit_rah with Cred_zaborg.
You need to set Cred_zaborg.Suma_zaborg=Valuta.Kurs*Cred_zaborg.Suma_zaborgVAL
There is a request:
select Credit_Rah.Credit_rah, kurs*Suma_zaborgVAL as SumaUAH
into C
from valuta
inner join credit_rah on Credit_Rah.Valuta_name=Valuta.Valuta_code
inner join cred_zaborg on Credit_Rah.Credit_rah=Cred_zaborg.Credit_rah;
update cred_zaborg
set Suma_zaborg = SumaUAH
where cred_zaborg.credit_rah=C.credit_rah
Answer the question
In order to leave comments, you need to log in
update cred_zaborg
set Suma_zaborg = kurs*Suma_zaborgVAL
from cred_zaborg
inner join credit_rah on Credit_Rah.Credit_rah=Cred_zaborg.Credit_rah
inner join valuta on Credit_Rah.Valuta_name=Valuta.Valuta_code
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question