Home > database >  The best way to SQL batch formula field implementation
The best way to SQL batch formula field implementation

Time:05-09

Known table: T1, fields are listed as follows:
Year bonus 1 bonus 2 month wage deductions paid-in
2021-01, 1000, 4000, 100 salary + bonus 1 - deductions
2021-02, 1000, 3500, 1000 salary + bonus + 1 bonus 2
,,,
The paid-in field of the salary or bonus in the front field together, may be paid-in formula to define each month are not identical,

Require the results of a query is:
Year bonus 1 bonus 2 month wage deductions paid-in
2021-01, 1000, 4000, 100, 4900 (1000 + 4000-100)
2021-02, 1000, 3500, 1000, 4500 (3500 + 1000)

Advice on how to implement? When the large amount of data, query performance will not be affected
.

CodePudding user response:

Using field value, rather than every query to dynamic calculation.

CodePudding user response:

I just want to use a custom formula to define several fields together, more flexible, rather than curing formula to add up,
  • Related