gpt4 book ai didi

mysql - mysql 中的 max() 返回 9999 不超过那个?

转载 作者:行者123 更新时间:2023-11-29 05:07:46 24 4
gpt4 key购买 nike

我有一个客户表,其中有一个名为 uniqueId 的字段类型:varchar(255) & Collat​​ion:utf8mb4_unicode_ci ..我想要找到最大的 uniqueId ..虽然我输入了 10000,但它总是返回 9999 ..这是为什么?

SELECT MAX(uniqueId) FROM `customers`

最佳答案

可能是你有一个字符串然后尝试转换

SELECT MAX( CAST(uniqueId AS UNSIGNED) ) FROM `customers`

关于mysql - mysql 中的 max() 返回 9999 不超过那个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44997992/

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