200", :id) 都失败了。 有-6ren">
gpt4 book ai didi

ruby-on-rails - rails : Using greater than/less than with a where statement

转载 作者:行者123 更新时间:2023-12-03 04:31:28 24 4
gpt4 key购买 nike

我正在尝试查找 id 大于 200 的所有用户,但我在特定语法方面遇到了一些问题。

User.where(:id > 200) 

User.where("? > 200", :id) 

都失败了。

有什么建议吗?

最佳答案

试试这个

User.where("id > ?", 200) 

关于ruby-on-rails - rails : Using greater than/less than with a where statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11317662/

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