Master detail table, totalizing fields

Asked

Viewed 253 times

0

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

1 answer

0


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

I would vote for the bank.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.