• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Which sql query will be faster

Scooty

Enemia.EU
Joined
Jul 24, 2010
Messages
564
Reaction score
14
Location
Kraków
Hi, i have 2 sql queries, which will be faster?


1.

PHP:
SELECT `name`, `rank_id` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = " .. getGuildId(getPlayerGuildName(cid)) .. ");


2.

PHP:
SELECT COUNT(  `gr`.`id` ) AS  `total` 
FROM  `players` AS  `p` 
LEFT JOIN  `guild_ranks` AS  `gr` ON  `gr`.`id` =  `p`.`rank_id` 
WHERE  `gr`.`guild_id` = " .. getGuildId(getPlayerGuildName(cid))


thanks for help
 
Back
Top