GORM Playground Link
https://github.com/go-gorm/playground/pull/1
Description
这样使用范围查询打印的Sql居然是这样的:
'''
SELECT count(*) FROM
coupon_record WHERE (coupon_id IN '1001','1') LIMIT 10
'''
这是有问题的,官网的例子也是错误的,很怀疑你们的例子有没有真实去跑过
正确的使用是这样
希望你们能对官网的例子进行修改,不要再继续误导新人
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 2 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: li-jin-gou
GORM Playground Link
Description
这样使用范围查询打印的Sql居然是这样的: ''' SELECT count(*) FROM
coupon_recordWHERE (coupon_id IN '1001','1') LIMIT 10 ''' 这是有问题的,官网的例子也是错误的,很怀疑你们的例子有没有真实去跑过正确的使用是这样
希望你们能对官网的例子进行修改,不要再继续误导新人
你好,看了一下运行的效果发现你应该使用的 gorm v1 , 但是看的文档是 gorm v2 的文档.
gorm v1: https://github.com/jinzhu/gorm 文档:https://v1.gorm.io/zh_CN/docs/query.htmlgorm v2: https://github.com/go-gorm/gorm 文档: https://gorm.io/zh_CN/docs/query.html
v1 和 v2 这里的用法是不一样的:kissing_heart: 推荐使用 gorm v2
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 2 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨