Jump to content

How to best approach this subquery?


sw0o0sh

Recommended Posts

Hi, I am working on a query for a highscores feature, that shows the amount of "kills" a certain player has made.

 

Here is an example of the main table format:

rsca2_players, which has the columns .user, .pass, .join_time, etc

 

It stores their kills in a table called

rsca2_kills, which has a common column .user, the person they killed: .killed, the .time it happened, etc.

 

So naturally, if a user gets a lot of kills, they have a lot of rows in the rsca2_kills table.

 

What I am trying to do is make it so I get a query that returns who has the most kills, (their .user id), and the COUNT of the kill rows. Is there any way to do this? I made a query but it never finishes loading, I'm assuming it is not efficient? Is there something else that can be done to make this work?

Link to comment
https://forums.phpfreaks.com/topic/230673-how-to-best-approach-this-subquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.