gpt4 book ai didi

mysql - 多项选择 wheres 与一项选择 where OR

转载 作者:行者123 更新时间:2023-11-29 11:10:01 25 4
gpt4 key购买 nike

我只是想知道哪种语句更有效。我正在循环遍历 UUID 列表(最多可能有 40 个 UUID),并且每次都进行选择。相反,我应该使用:

     SELECT * FROM `player_table` WHERE `playeruuid`=uuid1 OR `playeruuid`=uuid2 OR `playeruuid`=uuid3;

然后循环遍历结果集?

最佳答案

使用性能更好的IN():

 SELECT * FROM `player_table` WHERE `playeruuid` IN(uuid1,uuid2,uuid3);

除此之外,如果不进行测试,很难说哪个更有效。

关于mysql - 多项选择 wheres 与一项选择 where OR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40768868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com