Detail master table, totalizing fields

0

I am doing a work order control where in a work order several users will register products and labor, so I have three tables: - Service order (master) - Products (detail) - Labor (detail) The detail tables generate values that will have to represent a total in the master table, for example a total value of products and a total value of labor. I would like to know how best to get this total value if it is using database query feature or it is better to loop using programming in detail tables, remembering that the system will be multiuser.

    
asked by anonymous 31.03.2017 / 04:02

1 answer

0

In fact, you can actually get this sum with a SUM and bring the data already chewed to the application, it gains a bit in performance and ease of programming, since the complexity to generate this calculation in the bank is actually much smaller and you do not have to add the logical complexity of the iteration in your application, it literally becomes a processor only.

I would vote for the bank.

    
31.03.2017 / 13:32