Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Substring Problem



ludwig(at)kni-online(dot)de 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
Description: S/MIME Cryptographic Signature



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group