How to get a percentage from another table values

Viewed 36

Im working with nestjs, postgreSQL and TYPEORM. I need to calculate the percentage of another table values. For example:

table example

I want to make it efficient, because i can have a lot of drivers(with their respectives trips), so i cant make a lot of queries. How should i do it?

0 Answers
Related