我试图在SQL查询中显示时间戳。请有人帮帮我!? :d
SELECT company, COUNT(dmy) FROM `AdTracking` WHERE company =
'twitter' AND dmy BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01 00:00:00')
AND DATE_FORMAT(LAST_DAY(NOW()),'%Y-%m-%d 23:59:59') GROUP BY DAY(dmy)
这是SQL查询 - 注意它没有时间戳!
以下是表格:
谢谢你的帮助!
答案 0 :(得分:1)
只需在select中添加dmy
列,查看更新后的查询
SELECT company, COUNT(dmy), dmy FROM `AdTracking` WHERE company =
'twitter' AND dmy BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01 00:00:00')
AND DATE_FORMAT(LAST_DAY(NOW()),'%Y-%m-%d 23:59:59') GROUP BY DAY(dmy)