I can get same result for these queries, but which one is the fastest, and most efficient?
where in() or inner join?
SELECT `stats`.`userid`,`stats`.`sumpoint`
FROM `stats`
INNER JOIN users
ON `stats`.`userid` = `users`.`userid`
WHERE `users`.`nick` = '$nick'
ORDER BY `statoylar`.`sumpoint` DESC limit 0,10
and
SELECT `stats`.`userid`,`stats`.`sumpoint`
FROM `stats`
WHERE userid
IN (
SELECT userid
FROM `users`
WHERE `users`.`nick` = '$nick'
)
ORDER BY `stats`.`sumpoint` DESC limit 0,10
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…