我有这样的查询:
SELECT * FROM bcl1_logs where created_at between '2015-02-07' and '2015-02-10'
和这样的表格:
0 = "id":1,
"pc_name":"BCL101",
"created_at":"2015-02-07 22:25:44"
2 = "id":2,
"pc_name":"BCL101",
"created_at":"2015-02-07 22:25:44"
3 = "id":3,
"pc_name":"BCL101",
"created_at":"2015-02-10 22:25:44"
当我查询我的语句时,它只显示日期为“2014-02-07”的前两行,当我的查询日期为“2014-02”之间时,它不包括日期为“2015-02-10”的日期-07' 和 '2015-02-10'。
最佳答案
在查询中添加时间
SELECT * FROM bcl1_logs where created_at between '2015-02-07 00:00:00' and '2015-02-10 23:59:59'
关于php - Mysql between operator 只显示第一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28397178/