好吧,我已经尝试了很多,这看起来对我来说是正确的,但它不是:
SELECT COUNT( DISTINCT 'uid' ) AS `Records` , DATE( FROM_UNIXTIME( `epoch_timestamp` ) ) AS `Date`
FROM `log`
GROUP BY DATE( FROM_UNIXTIME( `epoch_timestamp` ) )
LIMIT 0 , 30
因为原因,它在每个日期旁边返回1。如果我拿出不同的内容,它似乎会给出那天的总记录数。
答案 0 :(得分:1)
好像你的sql不正确,尝试用'。
替换'uid'周围的单引号。SELECT COUNT( DISTINCT `uid` ) AS `Records` , DATE( FROM_UNIXTIME( `epoch_timestamp` ) ) AS `Date`
FROM `log`
GROUP BY DATE( FROM_UNIXTIME( `epoch_timestamp` ) )
LIMIT 0 , 30