如何在设定的日期参数中使用计数 (*) 函数?我有一个订单记录表,我只想计算特定日期的订单记录。
我的查询是
SELECT COUNT (*)
FROM bets
WHERE order_date='2018-01-22';
然后返回了这个
1 queries executed, 0 success, 1 errors, 0 warnings
cQuery: SELECT COUNT (*) FROM bets WHERE order_date='2018-01-22' LIMIT 0, 1000
Error Code: 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 '*) FROM bets WHERE order_date='2018-01-22' LIMIT 0, 1000' at line 1
Execution Time : 0 sec Transfer Time : 0 sec Total Time : 0.021 sec
最佳答案
删除count
和()
之间的空格
SELECT COUNT(*) ...
关于mysql - 带日期的 SQL Count (*) 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48381052/