RE: It counts everything not a specific day..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> OK,
> 
> Looks like there are two options....
> 
> I can either convert the unix timestamp colomn to a mysql 
> time one *OR*
> someone can tell me how to use unix timestamps in this query...
> 

Try something like this:

SELECT
    CONCAT(extract(year FROM FROM_UNIXTIME(time)),
    extract(month FROM FROM_UNIXTIME(time)))

    MAX(COUNT(*)) as max_monthly_views,
  time
FROM
    tececo_stats
group by
   CONCAT(extract(year FROM FROM_UNIXTIME(time)),
   extract(month FROM FROM_UNIXTIME(time)))

Regards
Joakim

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux