Re: It counts everything not a specific day..

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

 



Fixed it by doing multiple querys....


--
JJ Harrison
lizner2002@yahoo.com.au

"Noodle Snacks" <webmaster@tececo.com> wrote in message
20021019113342.17226.qmail@pb1.pair.com">news:20021019113342.17226.qmail@pb1.pair.com...
> Although my query returns the date of the day that had the highest number
of
> records inserted.
>
> It outputs the total number of records in the table..
>
> Can someone with more experience in SQL help me only count the number of
> records inserted on the day with the highest number of records?
>
> BTW the column time is a UNIX timestamp that is set upon insert.
>
> here is my query:
>
> $query = "
> SELECT
>     extract(year FROM time),
>     extract(month FROM time),
>
>     count(*) as monthly_views,
>   time
> FROM
>     tececo_stats
> group by
>    extract(year FROM time),
>    extract(month FROM time)
> order by
>    monthly_views desc
> limit 1
> ";
>
>
> --
> JJ Harrison
> lizner2002@yahoo.com.au
>
>



-- 
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