SQL Update table
Posted on 2002-03-30
I'm using Dbisam components and have a question.
I have 3 fields (integer) named aField, bField, cField.
it contains numbers like
0 , 20 , 20
20 , 25 , 45
45 , 10 , 55
cField is sum of aField and bField, and aField is sum of cField in previous record.
If i will change the bField in record1 from 20 to 25 how can i write a SQL command so the whole table will update to
0 , 25 , 25
25 , 25 , 50
50 , 10 , 60
My SQL knowledge is very small.
I have solved it until now with scrolling through the table with for i=1 to table1.recordcount and so on but its not a good solution , specially when the table will contains a lot more records.
Hope you understand my question.