COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo
GROUP BY stryearmonth ORDER BY stryearmonth ASC
btw, whats the reason for the subselect?
Oh, right, looks a bit stupid like this. It's eventually being filled
with something more useful, upon the user's request. It's dynamica
[EMAIL PROTECTED] wrote:
Type casting is required since 8.3, try
SELECT substring(date :: varchar from 1 for 7) AS stryearmonth,
^^
sorry but this hurts and should not recommended. I think depesz
approach with to_string() and the correct format string is the
better so
Type casting is required since 8.3, trySELECT substring(date :: varchar from 1 for 7) AS stryearmonth, COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo GROUP BY stryearmonth ORDER BY stryearmonth ASCBye...LudwigHi there, it seems to work with 8.1, but not anymore with 8.3. What is
On Tue, May 13, 2008 at 03:26:57PM +0200, Stefan Schwarzer wrote:
> SELECT substring(date from 1 for 7) AS stryearmonth, COUNT(id) AS
> countofnumber FROM (SELECT * from downloads ) AS foo GROUP BY
> stryearmonth ORDER BY stryearmonth ASC
Another way of doing this is by using date_trunc, i.e.:
On Tue, May 13, 2008 at 03:26:57PM +0200, Stefan Schwarzer wrote:
> it seems to work with 8.1, but not anymore with 8.3. What is wrong
> with this substring request? Or is it some installation issue? Thanks
> for any suggestion!
> SELECT substring(date from 1 for 7) AS stryearmonth, COUNT(id) A
Hi there,
it seems to work with 8.1, but not anymore with 8.3. What is wrong
with this substring request? Or is it some installation issue? Thanks
for any suggestion!
SELECT substring(date from 1 for 7) AS stryearmonth, COUNT(id) AS
countofnumber FROM (SELECT * from downloads ) AS foo GROUP