TP5 里面如何查询一个字段比另一个字段大的数据合集?

2018-01-05 17:30:15 +08:00
 crist

RT,这两个字段都是整形的时间戳数字,然后我使用下面方法: $maps['lastime'] = ['exp', "lastime > respontime"];

结果: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lastime > respontime ) ORDER BY id desc LIMIT 6000' at line 1[/var/……/thinkphp/library/think/db/Connection.php:388]

5276 次点击
所在节点    PHP
3 条回复
abccccabc
2018-01-06 08:58:18 +08:00
试下:where('lasttime', '>', 'respontime')
chelsea2019
2018-05-07 00:36:08 +08:00
可以加一下你 qq 和微信吗
crist
2018-05-07 09:43:11 +08:00
@chelsea2019 不用了,答案是$maps['lastime'] = ['exp', "> respontime"];

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/420404

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX