Search Postgresql Archives

Re: Substring Problem

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

 



ludwig@xxxxxxxxxxxxx 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 solution. (think of datetyle oddities) - one of the reasons
I believe most of the implicit casts have gone ayway.

COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo GROUP BY stryearmonth ORDER BY stryearmonth ASC

btw, whats the reason for the subselect?

T.

<<attachment: smime.p7s>>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux