gpt4 book ai didi

Mysql 随机选择给出意想不到的结果

转载 作者:行者123 更新时间:2023-11-29 18:39:45 27 4
gpt4 key购买 nike

我正在尝试从表中随机选择 4 个名称。这是我的查询:

SELECT RAND() FROM tbl_name ORDER BY id LIMIT 4;

这是我得到的输出 enter image description here

我的表结构: enter image description here

最佳答案

试试这个:

SELECT name FROM tbl_name ORDER BY RAND() LIMIT 4;

关于Mysql 随机选择给出意想不到的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45025753/

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