Hi Everyone

I have a question regarding SUM and Update.

is it possible to use SUM with Update ?

for example I have 3 tables

table_1:
idT1               Price
1                    20
2                    30
3                    50
4                    20

table_2:
idCust               Total                  idT1
2                       3011                 2
2                       221                   1
4                       2                       2
3                       31                     1
2                       302                   4
2                       30                     1

table_3:
idCust              Account
2                           200
3                           19
3                            99


I want to update table_3.Account        **IF**     (table_3.Account +
SUM(table_2.Total* table_1.Price) ) small than 1000 for each customer
(idCust)

is this possible using only SQL or I have to do it in programming ?


Thanks
--
echo "Hello World :)"

Reply via email to