Command lags the whole server
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Yes. GROUP BY does that and it produces one result set that can be read in one go. I usually switch the columns around so groupid is first and member count is second, but it shouldn't matter. A query like this:
PHP код:
SELECT member AS factionIdCOUNT(*) AS memberCount FROM Player GROUP BY member 
produces a result like this:
factionId memberCount
2 10
4 8
7 13
But the thing is, I need to calculate how many users are in that faction ID.
I don't have a column or something that stores the amount of players in it.
I need something like
Код:
format(string, sizeof(string), "SELECT COUNT(*) FROM `players` WHERE `Member` = '%d'", i);
Where the variabile I would be a variable in a loop, to loop through all the factions available.
Reply


Messages In This Thread
Command lags the whole server - by danielpalade - 10.01.2017, 00:12
Re: Command lags the whole server - by BiosMarcel - 10.01.2017, 00:29
Re: Command lags the whole server - by danielpalade - 10.01.2017, 01:40
Re: Command lags the whole server - by Lordzy - 10.01.2017, 01:55
Re: Command lags the whole server - by BiosMarcel - 10.01.2017, 15:45
Re: Command lags the whole server - by danielpalade - 10.01.2017, 16:51
Re: Command lags the whole server - by Vince - 10.01.2017, 17:12
Re: Command lags the whole server - by danielpalade - 10.01.2017, 17:19
Re: Command lags the whole server - by Vince - 10.01.2017, 21:21
Re: Command lags the whole server - by danielpalade - 10.01.2017, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)