Answer the question
In order to leave comments, you need to log in
How to write a query to the database?
There are 3 tables:
--users
-id
...
--table1 (there can be several entries with the same user_id, all works are added together)
-id
-user_id
-event_id
-participation_id
-individuality_id
--table2
-id (event_id is attached to it , participation_id, individuality_id)
-coefficient - there will be a number.
I need to get the first 5 users who have the highest product of all three coefficients.
Also, each user should be able to display the product of the coefficients.
I am using Laravel 6x
Answer the question
In order to leave comments, you need to log in
Well , join table2 three times under different aliases and you will have three coefficients at once.
What is the problem?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question